Hello,


I'm encountering an error with CRecordset::GetFieldValue(). It appears if I first get the value by name, and then try to get it by index, the return fails and returns CDBException. Example:

Code:
//res is a CRecordset * that is at the first row//

//get the field by name//
CString sSourceField = "SOMEFIELD";
CString sSourceValue;
res->GetFieldValue(sSourceField,sSourceValue);

//now loop through by index to get all the fields//
long nFields = res->GetODBCFieldCount();

for (long nIndex = 0; nIndex < nFields; nIndex++)
{
   CString sValue;
   res->GetFieldValue(nIndex,sValue); 
   //Fails to get "SOMEFIELD"'s value. Throws a CDBException
   //but has no description of the error!//
}

I noticed if I try to get other fields by name before the loop as well, they also fail to be extracted later. Any ideas why I cannot get the same field value twice with two different approaches (by name and then by index)? Does the system lock itself once you use one approach?