Home > Software engineering >  Turn a query function of MCF?
Turn a query function of MCF?

Time:10-08

Void PipeQuery: : OnBnClickedSerBtn ()
{
If (! M_pDatabase | |! M_pDatabase - & gt; IsOpen ())
{
return;
}
CADORecordset * p_ref=new CADORecordset (m_pDatabase);
This - & gt; The UpdateData (TRUE);
Cstrings cstr_SQL;
M_listcontrol. DeleteAllItems ();//remove all group


[ I] cstr_SQL. The Format (" where the select * from % s \ '% s \' \ '% s \' \ '% s \' ", "DZGX1", cListLeft, strCBText, m_Input_Edi t); [/I] //connection statement this place can write like this? , DZGX1 is a database table,

CWaitCursor at;
if (! P_ref - & gt; Open (cstr_SQL))
{
The delete p_ref; P_ref=NULL;
return;
}
Int iRowIndex=0;
while(! P_ref - & gt; IsEOF ())
{
Cstrings cstr_temp;
P_ref - & gt; GetFieldValue (_T (" dot "), cstr_temp);
Int iColIndex=m_listcontrol. InsertItem (iRowIndex cstr_temp, 0);

P_ref - & gt; The GetFieldValue (_T (" dot "), cstr_temp);
M_listcontrol. SetItemText (iRowIndex, + + iColIndex, cstr_temp);

P_ref - & gt; GetFieldValue (_T (" pipeline type "), cstr_temp);
M_listcontrol. SetItemText (iRowIndex, + + iColIndex, cstr_temp);

P_ref - & gt; GetFieldValue (_T (" pipeline materials "), cstr_temp);
M_listcontrol. SetItemText (iRowIndex, + + iColIndex, cstr_temp);

P_ref - & gt; GetFieldValue (_T (" landfill way "), cstr_temp);
M_listcontrol. SetItemText (iRowIndex, + + iColIndex, cstr_temp);

P_ref - & gt; GetFieldValue (_T (" diameter "), cstr_temp);
M_listcontrol. SetItemText (iRowIndex, + + iColIndex, cstr_temp);
P_ref - & gt; MoveNext ();
IRowIndex++;

}


CodePudding user response:

Don't quite understand what you ask
SQL statement does not need to slash the

SQL. The Format (_T (" insert INTO dt_doc_defaulttaskfortemplate (common_id temmonid, titlenum, titlename, fulle, speme, parentid, sortnum) VALUES ") \
_T (" (% d, % s, '% s',' % s', '% s',' % s', % d, % d) "),
'% s' is represented in the database type character type
  • Related