DAO accessing Jet v4

This is a discussion on DAO accessing Jet v4 within the Windows Programming forums, part of the Platform Specific Boards category; I've written a program which uses the following code to open a database - Code: #include "afxdao.h" ... CDaoDatabase daoDb; ...

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    98

    DAO accessing Jet v4

    I've written a program which uses the following code to open a database -
    Code:
    #include "afxdao.h"
    
    ...
    
    CDaoDatabase daoDb;
    daoDb.Open( strFullDBName );
    When I pass the name of an Access database created using Access97 - the Open works correctly, but if I pass the name of a database created using Access2000, it returns an error saying that the database format is unrecognised.

    I have both Access97 and Access2000 installed on my PC, and my Jet Driver version is 4.0......

    I need to be able to open Access2000 db's, and don't need to open Access97 db's. Can anyone tell me how to get this working?

    Thanks.
    There is no such thing as a humble opinion

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    When I need a connection string I create a file on my desktop called conn.udl. Click it and a little wizard comes up prompting you for connection info (driver - Jet, excel, ODBC etc and other stuff). Then click OK and open the file in notepad. Youll find a usable connection string inside.

    This works AOK for ADO...never bothered with DAO but it should work

  3. #3
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544

  4. #4
    Registered User
    Join Date
    Oct 2002
    Posts
    98
    Thanks very much for your help. I did search the Microsoft site, but didn't find the page you've posted - it's worked a treat!!

    Thanks for the conn.udl tip aswell, that's actually really handy!
    There is no such thing as a humble opinion

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. vector : accessing values
    By rahulsk1947 in forum C++ Programming
    Replies: 1
    Last Post: 06-01-2009, 10:26 PM
  2. Problems accessing logged on user via System.Security
    By conor20_ie in forum C# Programming
    Replies: 5
    Last Post: 11-16-2007, 07:52 AM
  3. Mfc Dao Access Database
    By LISANANA in forum Windows Programming
    Replies: 1
    Last Post: 07-03-2003, 02:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21