I don't know what you're talking about.
Regards.
will see what the data type is. Are you using a Unicode build? Do they
match?
--
Jonathan Wood
SoftCircuits Programminghttp://www.softcircuits.com
<aloha...@gmail.com> wrote in message
news:eb0ef428-3315-4c93-9b37-2111ad4c4453@l33g2000pri.googlegroups.com...
Hi ,
CString qStr;
CString cText1;
CString cText2;
CString cText3;
qStr.Format("SELECT ID, Text1, Text2, Text3 FROM myTable WHERE ID IN
(SELECT MAX(ID) FROM myTable)");
// assume there is one record return, ID (int), Text1- Text 3 (varchar
nullable),
if (rs.Open(CRecordset::forwardOnly, _T(qStr)))
{
CDBVariant pID;
CDBVariant StrText1;
CDBVariant StrText2;
CDBVariant StrText3;
rs.GetFieldValue((short)0, pID, SQL_C_SLONG);
MyID = pID.m_lVal;
rs.GetFieldValue((short)1, StrText1, SQL_C_CHAR );
cText1.Format("%s",strText1.m_pstring);
rs.GetFieldValue((short)2, StrText2, SQL_C_CHAR );
cText2.Format("%s",strText2.m_pstring);
rs.GetFieldValue((short)3, StrText3, SQL_C_CHAR );
cText3.Format("%s",strText3.m_pstring);
rs.Close();
}
..
// load into edit box
SetDlgItemText(IDC_EDIT_TEXT1, cText1);
SetDlgItemText(IDC_EDIT_TEXT2, cText2);
SetDlgItemText(IDC_EDIT_TEXT3, cText3);
Is this the correct way to retrieve the varchar value from table and
load into edit box ? I got funny character appear in edit box. Also
Text1 or Text2 or Text3 can be NULL as well.
Please help.
Regards,
Kenji