• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Connecting to MS Access 2000

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how do i connect to MS Access 2000. my database name is Josh.mdb.
thanks for any help.
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a User DSN entry set up first. You can always use a System DSN instead. Your DSN entry would be Josh:

I hope this is what you are looking for? If not, please supply a little more detail.
 
Josh Forrest
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
would i place the directory path in the url string? for example...
String url = "jdbc.odbc:josh\AccessDB\Josh.mdb";
conn = DriverManager.getConnection(url);
thanks for you help!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
How can make DSNless connection to ms access databas.
Thanx
kholu
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think you can. I don't believe anyone has written a driver to do that.
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't have to use the ODBC driver. There are other drivers available. Check the link below.
http://industry.java.sun.com/products/jdbc/drivers
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can bypass the DSN by giving an ODBC compatible URL. This is what I use to connect to my Access database without using a DSN:

The DSN-less connection assumes that
1. you have the specified access driver already installed on your computer.
2. the driver specified in 1 can successfully communicate with the database specified in the URL
3. The database exists in the location specified in the URL and has the same name.
4. You didn't add remove any spaces from the connection URL. If you did, re-cut and paste my code because the URL is space sensitive.
5. All the planets are aligned correctly
I have seen guys pull their hair out trying to get this one going, that's why I mention assumption 5. This is not an elegant solution that is portable. Just because it works for me or you, doesn't mean that it will work for a friend( too many OS and Access driver version variations ).
Jamie
[ January 23, 2003: Message edited by: Jamie Robertson ]
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I remember correctly, Sun does not recommend that the JDBC-ODBC bridge be used for production.
Found the link:
http://java.sun.com/j2se/1.3/docs/guide/jdbc/getstart/bridge.doc.html
The JDBC-ODBC Bridge driver is recommended only for experimental use or when no other alternative is available.
[ January 23, 2003: Message edited by: Thomas Paul ]
 
Sam Moran
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The single most reliable way is to use the DSN entry! It works! Simple and easy! This way you do not have to worry about the Planets! I've been there before. It takes 1 minute tops to create a DSN entry.
 
permaculture is giving a gift to your future self. After reading this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic