Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003
    Posts
    3

    Unanswered: MS Access JDBC connect string with *.mdw

    Hello:

    I'm trying to use JDBC with an access mdb that has a mdw. What is the correct connect string format in order to access the database?

    Here's what I have tried:

    Attempt 1:

    String url = "jdbcdbcRIVER={Microsoft Access Driver (*.mdb)};DBQ=my.mdb;SystemDB=my.mdw;UID=user;PWD=p wd";

    _connection = DriverManager.getConnection(url);

    Attempt 2:

    String url = "jdbcdbcRIVER={Microsoft Access Driver (*.mdb)};DBQ=my.mdb;SystemDB=my.mdw";

    _connection = DriverManager.getConnection(url, user, pwd);

    Attempt 3:

    String url = "jdbcdbc:MyDsn;UID<user>;PWD=<pwd>";

    _connection = DriverManager.getConnection(_connectString);

    Believe me, there were many other attempts, but you get the idea. Has anyone successfully connected via JDBC to an Access database that has workgroup security?

    Thanks,

    Joe

  2. #2
    Join Date
    Sep 2003
    Location
    Frankfurt
    Posts
    1

    Re: MS Access JDBC connect string with *.mdw

    Hi,

    I allways connect to MS Acces by ODBC. Try this:

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    // setup the properties
    java.util.Properties prop = new java.util.Properties();

    // Connect to the database
    con = DriverManager.getConnection( "jdbcdbc:***", prop);

    *** ist the name of the ODBC-Database you have defined before.

    greetings
    Jörg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •