Hi!
I have an Access 97 Database which I have to read from with C++.
All the text-fields are returned to c++ completely, but when a field
contains a number greater than 9 the return value to c++ is just the
first digit of that number.
With an Access 95 Database, it seems to work correctly, but I can't
use one in this case.
This is the Code I use:
CDaoRecordset rs;
//I have left out some irrelevant initializations
rs.Open(AFX_DAO_USE_DEFAULT_TYPE, "select * from TSW", NULL);
COleVariant olevar;
CString strData;
while (!rs.IsEOF()) {
rs.GetFieldValue("Distance",olevar);
olevar.ChangeType(VT_BSTR, NULL);
strData = (LPCSTR)olevar.pbstrVal;
cout << (const TCHAR*)strData << endl;
rs.MoveNext();
}
Please help!!
Thank You very much!