My programme, written in VB 2010, connects to an Access 2010 database which is not password protected. It operates perfectly on my laptop and also on the domain server, which is Windows Server 2012R, at my club.
I decided to protect the database file with a password. I inserted the following line of code to connect to the database and pass the password to the database so the file could be opened.
The code works as expected on my laptop but will not function on the server.
The single line of code I have used to make the connection in the server copy, which caters for the different directories on the server, is as follows:-
This is the only difference in code from the unprotected version to the protected version. However, it will not connect to the database.
The error message is " Cannot open database. It may not be a database that your application recognizes, or file may be corrupt"
My laptop has Microsoft.ACE.OLEDB.12.0 (2007)provider installed and the domain server has Microsoft.ACE.OLEDB.12.0 (2010) installed.
I have searched articles on Access connection strings and cannot find why it does not work on the server. Could it be a permissions setting on the domain?
If I remove the password on the database file, the programme works fine on both the laptop and the server, which of course it should but it does indicate that the syntax of the code is able to be understood by VB.
Can anybody help me solve this issue?
I decided to protect the database file with a password. I inserted the following line of code to connect to the database and pass the password to the database so the file could be opened.
Code:
membersadapter.Connection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Database\Members Database.accdb;Jet OLEDB:Database Password=MyPassword;"
The single line of code I have used to make the connection in the server copy, which caters for the different directories on the server, is as follows:-
Code:
membersadapter.Connection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\Server\Database\Members Database.accdb;Jet OLEDB:Database Password=MyPassword;"
The error message is " Cannot open database. It may not be a database that your application recognizes, or file may be corrupt"
My laptop has Microsoft.ACE.OLEDB.12.0 (2007)provider installed and the domain server has Microsoft.ACE.OLEDB.12.0 (2010) installed.
I have searched articles on Access connection strings and cannot find why it does not work on the server. Could it be a permissions setting on the domain?
If I remove the password on the database file, the programme works fine on both the laptop and the server, which of course it should but it does indicate that the syntax of the code is able to be understood by VB.
Can anybody help me solve this issue?