Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CDaoRecordset & Class Wizard

Posted on 1997-03-24
3
Medium Priority
?
258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
rhgaracci earned 300 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

636 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