This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Connecting to a password protected MSAccess Database  RSS feed

 
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
Boost this thread!