Solved

CDaoRecordset & Class Wizard

Posted on 1997-03-24
3
233 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:liux012897
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
rhgaracci earned 100 total points
ID: 1300634
I think the protected member variable you are referring to is m_nDefaultType.  This is just what it says, the default, if none is specified in the Open() call.  The actual type that is used is set in the member variable m_nOpenType, which is set in Open().  Setting the open type explicitly to dbOpenDynaset in the Open() call should work.  Note that the type specifiers for DAO are differnt that ODBC.  They do not interchange.
0
 

Author Comment

by:liux012897
ID: 1300635
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.
0
 

Author Comment

by:liux012897
ID: 1300636
Sorry, my mistake.  I just chekced, there is no such problem, I must have done something wrong when I "discovered" this problme.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Pressing cancel button with C# UI Automation 3 69
Window placement 17 82
FizzBuzz challenge 9 80
Line meaning 9 85
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question