Home > Software engineering >  SQL calls the database how to make the intermediate variable has multiple values
SQL calls the database how to make the intermediate variable has multiple values

Time:11-02

Int _list [100]={0};
for (int i=0; i{
If (m_userlist. GetItemState (I, LVIS_SELECTED)==LVIS_SELECTED)
{
_list [0] +=1;
_list [_list [0]]=I;
}
}
_Application app;
COleVariant vTrue (TRUE) (short), vFalse ((short), FALSE);
App. CreateDispatch (_T (" Word. Application "));
App. SetVisible (FALSE);
//Create New Doc
The Documents docs=app. GetDocuments ();
CComVariant TPL (_T (" ")), Visble, DocType (0), NewTemplate (false);
Docs. The Add (& amp; The TPL, & amp; NewTemplate, & amp; DocType, & amp; Visble);
//Add the Content: Text
Selection of sel=app. GetSelection ();
COleDateTime dt=COleDateTime: : GetCurrentTime ();
//Add Table
_Document saveDoc=app. GetActiveDocument ();
Tables Tables=saveDoc. GetTables ();
AutoFitBehavior CComVariant defaultBehavior (1), (1);

//
_variant_t RecordsAffected;
_bstr_t sno, sname, sex, sage, dui, duimingcheng, duishuoming, shujuchangdu;
_bstr_t temp.

for (int i=1; I & lt; _list [0] + 1; I++)
{
_bstr_t XXNM;

Temp="select * from the where elimination away='" + _bstr_t (m_userlist. GetItemText (_list [I], 0)) +"' ";
//the above is look for attributes' is' in 'talbe1'='is' list of the selected line the value of a.
Mysql. M_pRecordset=mysql. M_pConnection - & gt; Execute (temp, & amp; RecordsAffected adCmdText);
Sno=mysql. M_pRecordset - & gt; GetCollect (" name "elimination);
Sname=mysql. M_pRecordset - & gt; Use GetCollect (" disappear ");
Sex=mysql. M_pRecordset - & gt; GetCollect (" joint rules ");
Sage=mysql. M_pRecordset - & gt; GetCollect (" hair rules ");
XXNM=mysql. M_pRecordset - & gt; GetCollect (named "disappear");
Sel. TypeText (_T (" message name \ n "));
Cstrings _num=char (I + int (' 0 '));
//cstrings _title="header are not fixed" + _num + "\ n";
//sel. TypeText (_T (_title));
Sel. TypeText (_T (sno));
Sel. TypeText (_T (" \ n "));//input enter
Cstrings _title=_num + "eliminate use" + "\ n";
Sel. TypeText (_T (_title));
Sel. TypeText (_T (sname));
Sel. TypeText (_T (" \ n "));//input enter
Cstrings _title2=_num + "after elimination rules" + "\ n";
Sel. TypeText (_T (_title2));
Sel. TypeText (_T (sex));
Sel. TypeText (_T (" \ n "));//the semicolon etc.
Cstrings _title3=_num + "hair rules" + "\ n";
Sel. TypeText (_T (_title3));
Sel. TypeText (_T (sage));
Sel. TypeText (_T (" \ n \ n "));//the semicolon etc.
Temp="select * from message word where some code like elimination" + XXNM;
Mysql. M_pRecordset=mysql. M_pConnection - & gt; Execute (temp, & amp; RecordsAffected adCmdText);
_bstr_t XXZNM;
XXZNM=mysql. M_pRecordset - & gt; GetCollect (" cancellation code ");
Temp="select * from elimination list where the cancellation code like" + XXZNM;
Mysql. M_pRecordset=mysql. M_pConnection - & gt; Execute (temp, & amp; RecordsAffected adCmdText);
_bstr_t DUNM;
DUNM=mysql. M_pRecordset - & gt; GetCollect (named "DU");
Temp="select * from DUwhere DU code like" + DUNM;
Mysql. M_pRecordset=mysql. M_pConnection - & gt; Execute (temp, & amp; RecordsAffected adCmdText);
_bstr_t DUData;
_bstr_t DUMCData;
_bstr_t DUsm;
DUData=https://bbs.csdn.net/topics/mysql.m_pRecordset-> GetCollect (" DU ");
DUMCData=https://bbs.csdn.net/topics/mysql.m_pRecordset-> GetCollect (" data length ");
//XXZNM=mysql. M_pRecordset - & gt; GetCollect (" cancellation code ");
DUsm=mysql. M_pRecordset - & gt; GetCollect (" DU ");
Sel. TypeText (_T (" DU description: \ n "));//input enter
Sel. TypeText (_T (DUsm));
Sel. TypeText (_T (" \ n "));//input enter
//sel. TypeText (_T (" cancellation code: \ n "));//input enter
//sel. TypeText (_T (XXZNM));
Sel. TypeText (_T (" \ n "));//input enter
Sel. TypeText (_T (" DU: \ n "));//input enter
Sel. TypeText (_T (DUData));
Sel. TypeText (_T (" \ n "));//input enter
Sel. TypeText (_T (" data length: \ n "));
Sel. TypeText (_T (DUMCData));

}

App. SetVisible (TRUE);
Sel. ReleaseDispatch ();
Docs. ReleaseDispatch ();
SaveDoc. ReleaseDispatch ();
App. ReleaseDispatch ();
//TODO: add the control notification handler code
}

Output problems: the elimination of some code and cancellation code can be only one value, cannot find multiple is by reducing code corresponding to the cancellation of some code, again through the multiple word code found
Multiple DU code, then output multiple DU table DE multiple contents,






CodePudding user response:

Intermediate variable is the way you deal with, you use more than one variable to hold the result

CodePudding user response:

Don't understand you say what mean
  • Related