How to use a CDaoDatabase with an Access 2000 database

Posted on 2005-04-06
Last Modified: 2013-11-20

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
Question by:Dev2003
    LVL 3

    Accepted Solution

    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:

    Author Comment

    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.
    LVL 3

    Expert Comment

    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.


    Author Comment

    thats great , thank you for your help

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
    Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
    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.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    732 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

    22 Experts available now in Live!

    Get 1:1 Help Now