[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 326
  • Last Modified:

How to use a CDaoDatabase with an Access 2000 database

Hi,

I have written a little bit of code that opens a database, assesses the structure of the database and create an XML version, however it will only work if i change the database to 97 format.

What do I have to do to get this to work? Bearing in mind that the program is to be used by various companies and therefore various platforms will be used. It has to work on Windows 98 onwards.

thank you
0
Dev2003
Asked:
Dev2003
  • 2
  • 2
1 Solution
 
mactep13Commented:
If you're using MFC as shared lib, place this line in the App's InitInstance()

AfxGetModuleState()->m_dwVersion = 0x0601;

If you're building app using static MFC, see the following article:

http://support.microsoft.com/kb/236991/EN-US/
0
 
Dev2003Author Commented:
ok that seems to work fine, but what does it do?

does it still view the database as 2000 format? i am just worried incase it has an affect on the database relationships/functionality etc.
0
 
mactep13Commented:
There is a bug in the MFC 6.0 that uses DAO 3.5 (Jet 3.6). By telling the MFC to use version 6.01, you're telling it to use the DAO 3.6 (Jet4.0) format, which is the format for Access 2000 databases (and 2002/2003 as well). It will not affect on database relationships at all. It will just let you use the DAO objects with new db formats.
Your DB should not be converted to 97 format... use Native 2000 format and you will be able to read the database. If you have any other questions, let me know.

mactep
0
 
Dev2003Author Commented:
thats great , thank you for your help
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now