Skip to main content

Posts

Showing posts with the label MSAccess

How to troubleshoot MSAccess OleDb under Windows 7 64 bits

If you had a C# application with MS Access Database that did compile under Vista 32 bits with this connection string in app.config: [%--[configuration> [configsections> [/configsections> [connectionstrings> [add name="MyConnectionString" connectionstring="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\mydb.mdb" providername="System.Data.OleDb"> [/add> [/connectionstrings--%> You bought a brand new PC with Windows 7 64 bits and bad surprise when building your program again you got this dreadfull message error: Microsoft.Jet.OLEDB.4.0 provider is not registered on the local machine [%--using (OleDbConnection con = new OleDbConnection()) { ConnectionStringSettings connectionStringSettings = ConfigurationManager.ConnectionStrings["MyConnectionString"]; con.ConnectionString = connectionStringSettings; con.Open();--%> No panic, you just have to change the Platform Target in Visual Studio Settings | Build tab to x86...