File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes How to connect to Ms Access 2010 DataBase from Netbeans 7.1.1  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to connect to Ms Access 2010 DataBase from Netbeans 7.1.1  " Watch "How to connect to Ms Access 2010 DataBase from Netbeans 7.1.1  " New topic
Author

How to connect to Ms Access 2010 DataBase from Netbeans 7.1.1

Lucas Marumo
Greenhorn

Joined: Mar 23, 2013
Posts: 2

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


BLM
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36508
    
  16
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

Joined: Mar 23, 2013
Posts: 2

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

Joined: Oct 13, 2005
Posts: 36508
    
  16
Don’t know, but architecture often means 32 vs 64 bits. Are you using an x86_64 chip?
Ragavan Raju
Greenhorn

Joined: Dec 28, 2012
Posts: 10
This http://www.compiletimeerror.com/2013/03/ms-access-database-connectivity-in-java.html might help you out... Have a look...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to connect to Ms Access 2010 DataBase from Netbeans 7.1.1
 
Similar Threads
connection error when running web aplication using Tomcat 6.0
applet with MS Access database
set classpath of netbeans
NetBeans IDE 5.0 = how to connect my database
Netbeans and MS Access