3

I can happily connect to a System DSN using JDBC:

DriverManager.getConnection("jdbc:odbc:SysDSN");

If I try and use a File DSN however I get an error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Using:

DriverManager.getConnection("jdbc:odbc:FileDSN");

I've tried specifying a path to the File DSN and still get no joy.

Coley
  • 707
  • 6
  • 6

1 Answers1

2

I'd recommend using an DSN-less connection URL, as shown here:

Creating a DSN-less connection for MS Access within Java

You won't have to create a DSN that way.

PS - You did create the data source before you tried it your way, didn't you?

Community
  • 1
  • 1
duffymo
  • 305,152
  • 44
  • 369
  • 561
  • Yes, the File DSN was created. Didn't really want to go down the DSN-less route for various reasons. Would really like to see an example of a file DSN working in Java. – Coley Jan 30 '12 at 09:36
  • Is the file visible to your machine? Are you running on a 64-bit OS? If yes, I'm afraid you're out of luck - there is no JDBC-ODBC bridge driver for 64 bit machines. – duffymo Jan 30 '12 at 10:13
  • Not on 64-bit, and the file is very much visible as it is on the machine I'm running the code on. – Coley Feb 07 '12 at 15:12
  • *Still* no solution? I'd find something else besides Access that has a Type IV JDBC driver and get on with it. – duffymo Feb 07 '12 at 15:44