Re: CDaoRecordset derived class
GT schrieb:
"AliR (VC++ MVP)" <AliR@online.nospam> wrote in message
news:783mj.5281$Rg1.2236@nlpi068.nbdc.sbc.com...
CDaoRecordset is deprecated, meaning that you should not use it.
Is there a reason you don't want to use CRecrodset?
No reason at all, other than the rest of the app is written using CDao
classes and I have a pointer to a CDaoDatabase object, so can't just pass it
as a CDatabase. Or can I convert/cast the pointer? I don't know the
hierarchy of these classes.
It does not make sense to mix DAO and ODBC in the same project, when all the
other classes use DAO. DAO should still work, so you need to find your bug.
BTW, your code is somwhat strange:
> recordSet.Open(dbOpenTable);
> if (!recordSet.IsOpen())
> return;
When Open fails it throws a CDaoException*, so instead of asking for IsOpen()
you should catch the exception.
To find the cause of the error, it is a good idea to look at the generated SQL
query string after the open. IF that is wrong, you could step into the Open
method and looked what goes wrong.
Norbert