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. Problem is for Visual Studio Express because there is unfortunaly no such options even in “advanced” button.
Nevertheless you can edit your visual studio c# project file (.csproj) and put this snippet:
[%--[platformtarget>x86[/platformtarget>--%>
inside
[%--[propertygroup condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">--%>
This should solve the problem !
Comments: Replace [ with <
[%--[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. Problem is for Visual Studio Express because there is unfortunaly no such options even in “advanced” button.
Nevertheless you can edit your visual studio c# project file (.csproj) and put this snippet:
[%--[platformtarget>x86[/platformtarget>--%>
inside
[%--[propertygroup condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">--%>
This should solve the problem !
Comments: Replace [ with <
Comments
Post a Comment