Solved

CDaoRecordset & Class Wizard

Posted on 1997-03-24
3
221 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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 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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now