Article View: comp.lang.java.databases
Article #28Re: Connecting to MS Access without DSN?
From: 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
Technical Details
Message-ID:
<3996815B.6482C644@web.de>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<398C309B.A19117DC@web.de> <MPG.13f89d7e419e056d989697@news.swbell.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113ae9,f814c85ba108c2bc X-Google-Attributes: gid113ae9,public X-Google-Thread: 1073da,f814c85ba108c2bc X-Google-Attributes: gid1073da,public X-Google-Thread: 10a146,f814c85ba108c2bc X-Google-Attributes: gid10a146,public X-Google-Thread: 107d46,f814c85ba108c2bc X-Google-Attributes: gid107d46,public From: Roland Zumkeller <Roland.Zumkeller@web.de> Subject: Re: Connecting to MS Access without DSN? Date: 2000/08/13 Message-ID: <3996815B.6482C644@web.de> X-Deja-AN: 657745811 Content-Transfer-Encoding: 7bit References: <398C309B.A19117DC@web.de> <MPG.13f89d7e419e056d989697@news.swbell.net> X-Accept-Language: de Content-Type: text/plain; charset=us-ascii X-Trace: fu-berlin.de 966165905 8115382 62.54.3.67 (16 [43476]) Mime-Version: 1.0 Newsgroups: comp.lang.java.databases,borland.public.jbuilder.database,comp.lang.java.programmer,comp.lang.java.help