Solved

CDaoRecordset & Class Wizard

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

911 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

23 Experts available now in Live!

Get 1:1 Help Now