Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to connect to Ms Access 2010 DataBase from Netbeans 7.1.1

 
Lucas Marumo
Greenhorn
Posts: 2
Android Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Helllo Guys

I want to connect to Ms Access 2010 Database and i am currently using NetBeans 7.1.1 the code runs just fine but it can not connect

bellow is my code


i included an exception to handle a case when the code can not connect
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
I have added code tags to your code, which make it look much better and clicked the disable smilies box, so :‍odbc doesn’t appear as dbc.

What exactly goes wrong? Do you suffer an Exception? It would be better to use ex.printStackTrace();, so you would know the exact details of the Exception, including where it occurred. How did you add that driver to your classpath?
 
Lucas Marumo
Greenhorn
Posts: 2
Android Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Campbell i used the
ex.printStackTrace(); and this is the error message i got

"java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application"

is it the issue of the Driver being 32bits and my application being 64 bits
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don’t know, but architecture often means 32 vs 64 bits. Are you using an x86_64 chip?
 
Ragavan Raju
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This http://www.compiletimeerror.com/2013/03/ms-access-database-connectivity-in-java.html might help you out... Have a look...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic