Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
I'm having problems using the jdbc-odbc bridge with an MS Access database and a file DSN. If I use a system DSN, it works fine but it does not seem to find the file DSN for some reason (And I HAVE to use a file DSN in this instance, for reasons I won't bore you with) - this is the error-message: "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified" This is my example code: import java.sql.*; public class TestAccess public static void main(String[] args) conn = DriverManager.getConnection("jdbc:odbc:test", "", ""); stmt = conn.createStatement(); while(results.next()) The file DSN was set up using the Win2K ODBC administrator and it is in the default location of: C:\ProgramFiles\CommonFiles\ODBC\DataSources and is called "test.dsn" - it looks like this: [ODBC] And the COMP150.MDB file is in the location specified in the DBQ= property. Why can't ODBC find this DSN, when it's fine with a system DSN? Is there something in my naming syntax that's wrong, or do I need to tell ODBC it's using a file DSN in some way? I'd be very grateful for any/all assistance. Thanks.
Replies:
|
Sponsored Links
|