How to connect to MS Access 2010 which is in .accdb format using C#. Apparently the OleDbConnection throws an exception of 'Unrecognized database format'.
Your connection string should be of the format:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;
i'm guessing you are still using Jet engine 4
try this connection string
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;
-
1To state an obvious fact, this will work only on copies of Windows where either Access is installed, or the ACE has been separately installed. Jet 4, on the other hand, is installed on all copies of Windows starting with Win2000. – David-W-Fenton Dec 19 '10 at 2:34
-
I use the Data Sources wizard to generate the connection string for me. You can find this in the settings.settings file. – Jim Lahman Feb 6 '13 at 16:37
IF you password For ACESSS DataBase
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccessFile.accdb; Jet OLEDB:Database Password=MyDbPassword;