javams-access-2010password-protectionjdbc-odbc

Password not recognized in Java for MS Access


I have to import data from a MySQL DB to a MS Access DB. I use JDK8 on a Windows7Pro 64 bit.

When I run the code I get an exception at the following line of code:

String database = .../
Connection conn = DriverManager.getConnection(database, "", "mypw");

and the error is:

java.sql.SQLException: [Microsoft][Driver ODBC Microsoft Access] Not a valid password

However, when I open the db via MSAccess the password is accepted. What am I missing? Maybe something related to the user value?


Solution

  • Try the username as "Admin"

    I don't know why exactly it work, but I know it works.