• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connecting to a password protected MSAccess Database

 
Mohammed Dohad
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was wondering if anyone knows how to connect to an MSAccess database that is password protected?
I tried several different forms of conect strings but didn't work.
-Mohammed
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Mohammed
Following code may help you to overcome the problem.

// Initialise and load the JDBC-ODBC driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("Driver Initialised....");

// To ge the database connection
Con=DriverManager.getConnection("jdbc dbc:StudentDSN","UID ","PW");
System.out.println("Connection made.....");

In the field 'UID' specify your used ID to MS-Acess database.
in 'PW' specify password.
It shoulod work..
Fazlan

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic