Thread: DAO accessing Jet v4

  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,793
    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

  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, 09: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, 01:18 PM