Results 1 to 2 of 2
  1. #1
    gkalanidhi is offline Member
    Join Date
    Oct 2013
    Posts
    1
    Rep Power
    0

    Default Connect MSAccess 2007 in Window64 bit

    Hi
    I am trying to connect MS Access in Window 7 64 bit OS, getting Driver related issue.

    Option 1: Connect MS Access using DSN

    created DSN name through %windir%\SysWOW64\odbcad32.exe
    Java code using to connect MS Access:

    Driver d = (Driver)Class.forName("sun.jdbc.odbc.JdbcOdbcDrive r").newInstance();
    con = DriverManager.getConnection("jdbc:odbc:db1","","") ;

    while running i am getting "java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application" Error.

    Option 2 : Connect MS Access mdb file without DSN

    Java Code using to connect MS Access:

    Driver d = (Driver)Class.forName("sun.jdbc.odbc.JdbcOdbcDrive r").newInstance();
    String path = new java.io.File("D:/Database1.mdb").getAbsolutePath();
    String DATABASE ="jdbc:odbc:Driver= Microsoft Access Driver (*.mdb, *.accdb);DBQ="+path;
    con=DriverManager.getConnection(DATABASE,"","");

    now i am getting "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified" Error.

    Could you please help to solve this issues

    Thanks
    Nidhi

  2. #2
    aschild is offline Member
    Join Date
    Oct 2013
    Posts
    1
    Rep Power
    0

    Default Re: Connect MSAccess 2007 in Window64 bit

    Quote Originally Posted by gkalanidhi View Post
    Hi
    I am trying to connect MS Access in Window 7 64 bit OS, getting Driver related issue.
    When you are running a 64-Bit JVM, then the ODBC drivers must also be 64Bit.
    Per default Microsoft does only install the 32bit variants of the odbc drivers for access, excel etc.

    You can download the 64 bit variants from here:

    Download Microsoft Access Database Engine 2010 Redistributable from Official Microsoft Download Center

    This should then work.

Similar Threads

  1. getting an attachement from MSAccess
    By liluma in forum New To Java
    Replies: 4
    Last Post: 06-09-2011, 09:31 AM
  2. MSAccess, rs.next() and SELECT DISTINCT
    By mine0926 in forum JDBC
    Replies: 13
    Last Post: 01-26-2011, 01:23 AM
  3. Date problem in MSAccess
    By realosso in forum New To Java
    Replies: 1
    Last Post: 06-02-2010, 12:32 PM
  4. How to connect to msaccess?
    By azzaiel in forum New To Java
    Replies: 1
    Last Post: 06-28-2009, 02:19 AM
  5. MSAccess and hibernate
    By bbq in forum JDBC
    Replies: 3
    Last Post: 04-30-2008, 04:38 PM

Posting Permissions

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