Connecting to ACCDB format MS-ACCESS database through OLEDB
Asked Answered
C

1

10

I've recently made another question about connecting to MS-ACCESS database with .NET in C# or VB.NET. It worked just as intended with MDB, but with accdb it caused an exception in

conn.Open();

which follows:

alt text http://dl.dropbox.com/u/3045472/accdb_fail.png

Is there another way to do this? My original intention (like stated in the original question) is gathering some (actually, a lot of) fields.

Calabria answered 3/3, 2010 at 17:11 Comment(2)
The key point in the answer is that MDB is the Jet 4 format (or earlier formats, e.g., Jet 3.x, and backward-readable in the Jet 4 providers), and ACCDB is the format for the ACE (which is really Jet 4.5 or maybe Jet 5), so you need to use the provider for ACE (which is also able to read/write Jet 4/3.x and probably Jet 2.x).Upper
It actually worked without any aditional installation, but i'm keeping the link in case it's needed in the client.. And Thanks!Calabria
M
13

Use ACE 4 driver, download it here then use following connection string:

"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\marcelo.accdb;Jet OLEDB:Database Password=MyDbPassword;"

Minette answered 3/3, 2010 at 17:15 Comment(3)
i think yes. or create client-server application with thin clientsMinette
Worked with reader.GetValue(3).ToString() Do you know why it didn't with getstring, even though it was a name?Calabria
@Minette I ask a related Question here: #14476468 , would you please check itQuinacrine

© 2022 - 2024 — McMap. All rights reserved.