Link to home
Start Free TrialLog in
Avatar of liux012897
liux012897

asked on

CDaoRecordset & Class Wizard

When I use Class Wizard to derive a class from CDaoRecordset, I can set the type to be either "snapshot" or "dynaset".  From the file generated by Class Wizard, the only difference between these two types are that the variable m_nDefaultType is initialized differently.  
However, if I derive a "snapshot" class and manually change the value of the variable m_nDefault to use it as a "dynaset", I got "operation not supported error".
Yes, I did change the variable before I open the record set and I also tried to supply arguments to the Open() function to make sure it is opened as a "dynaset".
Anyway, this behavior seems strange.  I suspect that when the Class Wizard created the "snapshot" class, it also registered its "type" somewhere so that it can only be used as a "snapshot".  But I don't know much about OLE or whatever topics related to this.
Any explanation will be appreciated.
ASKER CERTIFIED SOLUTION
Avatar of rhgaracci
rhgaracci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of liux012897
liux012897

ASKER

The problem is, I did try to open it by setting the type to dbOpenDynaset in the Open() call and get the same message "operation not supported". Just in case, I am going to check it one more time.
Sorry, my mistake.  I just chekced, there is no such problem, I must have done something wrong when I "discovered" this problme.