connecting to specific access database file

A

ali

hi there again hope you are not getting bored from my questions

first a lot of thanks to Ryan Stewart and Chris Smith for their link on
my last question about how to connect my programe to access database

i really learned a lot from there

but still

i hope there is a way to connect my programe to an specific database
file so i dont have to make dns settings

like making my program connect to the file labs.mdb which is in its
diroctry

as it is made via visual basic by datacontrol
so hope there is a way to do that in java
 
C

Chris Smith

ali said:
but still

i hope there is a way to connect my programe to an specific database
file so i dont have to make dns settings

Unfortunately, if you're using the ODBC bridge driver, there's no really
reliable way to make the connection without defining an ODBC data source
name. ISTR that you can use something like:

jdbc:eek:dbc:MS Access Database;file=c:\myfile.mdb

but that assumes that the default ODBC name for a generic Access
database is present and hasn't been modified. That's not necessarily a
safe assumption. I'm also not sure of the attribute name, and it might
be something other than "file". Also, If you take the approach above,
remember that backslashes should be escaped in a string literal.

I mentioned earlier that there's a free edition of MS SQL Server that
has a better JDBC driver. Could you consider using that instead?

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
A

ali

thanks a lot again
jdbc:eek:dbc:MS Access Database;file=c:\myfile.mdb
worked very well thanks again


but yes its not garenteed to work on all the computer

so about MS SQL Server that you told me about can you tell me more as
i said i am very new to database thing so i only know very little about
ms access it self but hope you will provide me with good sources so i
can undestand MS SQL Server

and also where to get it from how it is better and does it provide me
in java what i need ??!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top