Thread View: comp.lang.java.databases
3 messages
3 total messages
Started by Roland Zumkeller
Sat, 05 Aug 2000 00:00
Connecting to MS Access without DSN?
Author: Roland Zumkeller
Date: Sat, 05 Aug 2000 00:00
Date: Sat, 05 Aug 2000 00:00
32 lines
2004 bytes
2004 bytes
Hi,
Does someone kno how to connect via JDBC to a MS Access database without
creating a System DSN?
I heard this would be possible with a statement like this:
Connection conn = DriverManager.getConnection(
"jdbc:odbc:;DRIVER={Microsoft Acces Driver *.mdb)};DBQ=C:\\mydb.mdb",
"", "");
I've tried this using "sun.jdbc.odbc.JdbcOdbcDriver" with both JDK 1.2
and 1.3. I always get a:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name
not found and no default driver specified
I heard it works with Microsoft's "com.ms.jdbc.odbc.JdbcOdbcDriver", but
using this with (MS SDK 4.0) I get the same Exception.
The database mydb.mdb exists and I've also tried the url
"jdbc:odbc:DRIVER={Microsoft Acces Driver (*.mdb)};DBQ=C:\\mydb.mdb"
(without the first ";"). I've also connected to System DSNs successfully
with both SDKs, but that's just what I want to avoid.
I would be really happy if someone could help me.
Thanks!
Roland
PS. If it's necessary to use Microsoft's driver, how can it used within
Sun's SDK? (Just adding some zip-file to the classpath didn't work for
me.)
Re: Connecting to MS Access without DSN?
Author: D.M. Mattix
Date: Mon, 07 Aug 2000 00:00
Date: Mon, 07 Aug 2000 00:00
41 lines
2431 bytes
2431 bytes
In article <398C309B.A19117DC@web.de>, Roland.Zumkeller@web.de says...
> Hi,
> Does someone kno how to connect via JDBC to a MS Access database without
> creating a System DSN?
>
> I heard this would be possible with a statement like this:
> Connection conn = DriverManager.getConnection(
> "jdbc:odbc:;DRIVER={Microsoft Acces Driver *.mdb)};DBQ=C:\\mydb.mdb",
> "", "");
>
> I've tried this using "sun.jdbc.odbc.JdbcOdbcDriver" with both JDK 1.2
> and 1.3. I always get a:
> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name
> not found and no default driver specified
>
> I heard it works with Microsoft's "com.ms.jdbc.odbc.JdbcOdbcDriver", but
> using this with (MS SDK 4.0) I get the same Exception.
>
> The database mydb.mdb exists and I've also tried the url
> "jdbc:odbc:DRIVER={Microsoft Acces Driver (*.mdb)};DBQ=C:\\mydb.mdb"
> (without the first ";"). I've also connected to System DSNs successfully
> with both SDKs, but that's just what I want to avoid.
>
> I would be really happy if someone could help me.
>
> Thanks!
>
> Roland
>
>
> PS. If it's necessary to use Microsoft's driver, how can it used within
> Sun's SDK? (Just adding some zip-file to the classpath didn't work for
> me.)
>
>
Maybe it's just a typo but it occured twice. My ODBC MS Access driver
has two s's in Access. Since this is a keyed lookup if your code has
only one s in Access then that might be the problem.
Mike Mattix
dmmattix@swbell.net
Re: Connecting to MS Access without DSN?
Author: Roland Zumkeller
Date: Sun, 13 Aug 2000 00:00
Date: Sun, 13 Aug 2000 00:00
47 lines
2584 bytes
2584 bytes
Thanks, it was a typo.
Roland
"D.M.(Mike) Mattix" schrieb:
>
> In article <398C309B.A19117DC@web.de>, Roland.Zumkeller@web.de says...
> > Hi,
> > Does someone kno how to connect via JDBC to a MS Access database without
> > creating a System DSN?
> >
> > I heard this would be possible with a statement like this:
> > Connection conn = DriverManager.getConnection(
> > "jdbc:odbc:;DRIVER={Microsoft Acces Driver *.mdb)};DBQ=C:\\mydb.mdb",
> > "", "");
> >
> > I've tried this using "sun.jdbc.odbc.JdbcOdbcDriver" with both JDK 1.2
> > and 1.3. I always get a:
> > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name
> > not found and no default driver specified
> >
> > I heard it works with Microsoft's "com.ms.jdbc.odbc.JdbcOdbcDriver", but
> > using this with (MS SDK 4.0) I get the same Exception.
> >
> > The database mydb.mdb exists and I've also tried the url
> > "jdbc:odbc:DRIVER={Microsoft Acces Driver (*.mdb)};DBQ=C:\\mydb.mdb"
> > (without the first ";"). I've also connected to System DSNs successfully
> > with both SDKs, but that's just what I want to avoid.
> >
> > I would be really happy if someone could help me.
> >
> > Thanks!
> >
> > Roland
> >
> >
> > PS. If it's necessary to use Microsoft's driver, how can it used within
> > Sun's SDK? (Just adding some zip-file to the classpath didn't work for
> > me.)
> >
> >
> Maybe it's just a typo but it occured twice. My ODBC MS Access driver
> has two s's in Access. Since this is a keyed lookup if your code has
> only one s in Access then that might be the problem.
>
> Mike Mattix
> dmmattix@swbell.net
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads