CDaoRecordset & Class Wizard
Posted on 1997-03-24
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.