This question already has an answer here:
I am developing a software using VB .NET in a computer running Windows 7 32-bit OS.
The software contains those lines of code as shown below:
Dim cn As New OleDbConnection
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & fileNameStr & ";Jet OLEDB:Database Password=xxxxxx"
cn.Open()
The codes above open a Microsoft Access file (extension: mdb), which is protected by a password.
In my computer (32 bit Windows 7), the codes work fine.
However, when I test this software in other computers (64 bit Windows 7), I got the error message as shown below:
I have tried to install another driver called "Microsoft Access Database Engine 2010 Redistributable" in those computers getting the error message, however it does not solve the problem.
Can you suggest where my mistakes are and how to resolve them?
Thank you.
Change your application to compile under x86 and not AnyCPU or x64. To do this in VB: