
CDaoRecordset::GetFieldValue Error
Quote:
>COleVariant temp
>RS->GetFieldValue(TableName, temp);
>CString another_temp = temp.bstrVal;
>I always get an error when running GetFieldValue that says "Item not
>found in this collection." All of the #includes are there, the path
[snip]
Your problem is that you obviously misplaced TableName variable.
GetFieldValue() wants a field name not a table name. The proper way to
do this is:
RS->Open (dbOpenTable, TableName);
/* set an index */
/* seek to a record */
RS->GetFieldValue ("my field name", temp);
... or you can...
RS->Open (dbOpenSnapshot, "SELECT * FROM my_table");
/* etc */
HTH
--
Alex.
Waver: Multiprocessor WAV and MP3 converter
http://waver.htmlplanet.com
**SPAM FREE REPLY ADDRESS