File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Win7 MSAccess Cannot get DB Connection

 
Will Barbee
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After correcting for the 32-bit/64-bit driver problem in Win7,
I entered the necessary (I thought) DSN's to get MSAccess
usage with a Java program.

I went under c:\windows\syswow64\ to find odbcad32 and ran it
to get the 32-bit drivers set up:

On the first display under the System DSN tab, I clicked "Add".
On the next window "Create New Data Source,
I clicked on Microsoft Access Driver (*.mdb) and clicked "Finish".
On the third window, I entered th MSAccess DB name in the Data
Source Name field "Atb_Basc".
I entered a description in the Description field.
Under Database, I clicked on "Select" then found the MSAccess
database, clicked on it to update it into the DSN.
At this point, the System DSN should have the Data Source Name
connected to the actual database.

I repeated the above for a User DSN just to be sure.

All appears to be correct but I get an error message during the
connection process. (Let me add that this code was working fine
when I was using WinXP.) The Java code snippets are:



And the full error message displayed is:
"Failed to get DB connection./java.sql.SQLException: [Microsoft][ODBC Driver Manager]
Data Source Name not found and no default driver specified."


But I used that Data Source Name in the Driver setup and I connected it to the DB.

Obviously I've missed or forgotten something since the last time I worked on this
set of programs.

Can someone please advise what I am missing?
Thank you
 
Will Barbee
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ARRRRRGGGHHHH! I mis-spelled the name.

Lessons Learned:
After all these years, spelling can be your biggest error producer.
Always re-check spelling (especially before posting on JavaRanch).
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic