I have a class, CBVRecordSet, derived from CDaoRecordset. This class was
created from a table in an Access database. The table has these fields:
Basis Vector ID
Base Material Name
Now, when I try to open a recordset with the following statements:
sqlStatement.Format ("SELECT DISTINCT [Atom Name] FROM [BasisVector] "
"WHERE [Base Material Name] = \'%s\' ORDER BY [Atom Name]", bmName);
bvRc.Open (dbOpenDynaset, LPCTSTR (sqlStatement));
I get an error stating "GetRows failed. The requested column is not a member
of this recordset."
What is really funny is if I use the same SQL statement in a query in
Access, substituting a valid bmName, the query completes correctly, without
I suspect that there is something specifically wrong in my syntax. The
reason I say this is because if I change the syntax to:
"SELECT * FROM [BasisVector] WHERE [Base Material Name] = \'%s\' ORDER BY
I don't get the error message.
Does anyone know what is going on here? What am I doing wrong? Thanks in
advance for any suggestions.