I have created a software using VB.NET in a 32-bit Windows 7 OS.
It contains those line of codes below:
Dim cn As New OleDbConnection
cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & fileNameStr & ";Jet OLEDB:Database Password=xxxxxxx"
cn.Open()
The codes open a MDB file (Microsoft Access file) protected by a password.
When I run the software in my computer, it works well.
However, when it is tested in another computer, an error message appears saying "Cannot open a database created with a previous version of your application."
The error message is shown after the third line of code.
Could you suggest where my mistakes are and how do I resolve the problem.
Thank you.
When I run the software in my computer, it works well.
However, when it is tested in another computer, an error message appears saying "Cannot open a database created with a previous version of your application."
This can happen when the different machines have different versions of the Access Database Engine installed. Specifically, the error message will appear if
Access 2013 removed support for the Access 97 file format.
This can be slightly confusing if your connection string contains
Provider=Microsoft.ACE.OLEDB.12.0
because the Access 2007 (12.0), Access 2010 (14.0), and Access 2013 (15.0) versions of the Access Database Engine all register the provider under the "12.0" name to offer some degree of backward compatibility. So for any given machine with Access 2007+ on it you may specify
Microsoft.ACE.OLEDB.12.0
but what you are actually using is
Microsoft.ACE.OLEDB.12.0
on an Access 2007 machine
Microsoft.ACE.OLEDB.14.0
on an Access 2010 machine
Microsoft.ACE.OLEDB.15.0
on an Access 2013 machine
That is why the same third-party application can open an .mdb file on one machine (with Access 2007 or 2010 installed) but not on another machine (with Access 2013 installed).