Accessing versions of Access using VC++ & DAO 
Author Message
 Accessing versions of Access using VC++ & DAO

Hi All,

I'm inherited a fairly large application written in C++ and DAO (and other
technologies).  It works fine with Access97 DBs. I've got to upgrade it to
be able to use Access2000.

The database is processed by a CDaoDatabase object, using its Open method
with one argument: the fully qualified name of the database.  What I need is
a way to specify the DAO version.

I have done this using VC++ to run a VBScript where the DB engine is
specified when creating a DAO object --
I specified DAO.DBEngine.35 (for Access97) or .36 (for 2000).

To keep the app from getting more complicated by introducing scripting, I
need to specify the DB Engine in C++ terms.  I looked at TN054 (Calling DAO
Directly While Using MFC DAO Classes) but don't see enough detail there to
solve my problem.

Any suggestions would be appreciated.  If not too inconvient, I'd appreciate

newsgroups during the day because of a firewall.

Regards,
Richard

P.S. This was posted previously (with no response) to:
- microsoft.public.access.modulesdaovba &
- microsoft.public.vb.database.dao
because I didn't realize that this NG is the appropriate place.



Sun, 09 Nov 2003 16:31:11 GMT  
 Accessing versions of Access using VC++ & DAO
Hi All,

I'm inherited a fairly large application written in C++ and DAO (and other
technologies).  It works fine with Access97 DBs. I've got to upgrade it to
be able to use Access2000.

The database is processed by a CDaoDatabase object, using its Open method
with one argument: the fully qualified name of the database.  What I need is
a way to specify the DAO version.

I have done this using VC++ to run a VBScript where the DB engine is
specified when creating a DAO object --
I specified DAO.DBEngine.35 (for Access97) or .36 (for 2000).

To keep the app from getting more complicated by introducing scripting, I
need to specify the DB Engine in C++ terms.  I looked at TN054 (Calling DAO
Directly While Using MFC DAO Classes) but don't see enough detail there to
solve my problem.

Any suggestions would be appreciated.  If not too inconvient, I'd appreciate

newsgroups during the day because of a firewall.

Regards,
Richard

P.S. This was posted previously (with no response) to:
- microsoft.public.access.modulesdaovba &
- microsoft.public.vb.database.dao
because I didn't realize that this NG is the appropriate place.



Sun, 09 Nov 2003 16:59:00 GMT  
 Accessing versions of Access using VC++ & DAO
Please don't post responses to this ... let's use the other copy of this
message.

Sorry folks.

I entered this post on my MSN account but their servive wasn't responding,

I see now that the MSN account actually worked, too.



Sun, 09 Nov 2003 17:11:28 GMT  
 Accessing versions of Access using VC++ & DAO
Hi All,

Browsing through earlier messages, I found this great response submitted by
Craig circa May 5:

Quote:
> You need to add this line to your InitInstance of your MFC App:
> AfxGetModuleState()->m_dwVersion >= 0x0601;
> This will fool the compiler into using the 3.6 DLL's

I will test this to see if it can be used dynamically so that if opening an
MDB fails, I can change the version and try again.  Thats what I was able to
do via scripting.

Thanks to Craig for that post.

Regards,
Richard



Sun, 09 Nov 2003 17:43:11 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. version 6 of MS VC++ and Access 2000 using dao

2. version 6 of MS VC++ and Access 2000 using dao

3. Strange ODBC errors using DAO to access linked tables in Access .MDB

4. Problem accessing Access 2000 database using DAO. - URGENT

5. Restructuring a Microsoft Access database using VC++ 5 and DAO

6. Restructuring a Microsoft Access using VC++ 5 and DAO

7. Access violations using DAO with VC 4.2

8. How to read Access 2000/2002 DB using VC++ 6 and DAO

9. How can I call a Access-Macro using DAO and VC++

10. Updating Access tables Using DAO with VC++

11. Accessing an Ms Access 2000 Query using VC++, via ODBC

12. how to open ms access 2000 mdb via vc++ and dao

 

 
Powered by phpBB® Forum Software