I am trying to run a query on an access database located on a distant server (my code is written in C#). I use the following code and connection string:
public static string MadoneConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source= {0}; Persist Security Info = False; User ID = {1}; Password ={2};"
;
string ConnectionString = string.Format(Constants.MadoneConnectionString, DatabasePath, userId, password);
using (OleDbConnection cnn = new OleDbConnection(ConnectionString))
{
//..my code..//
int count = 0;
using (OleDbCommand cmd = new OleDbCommand(query, cnn))
{
cnn.Open();
using (OleDbDataReader reader = cmd.ExecuteReader())
{
// my code //
}
}
}
When I run the code I have the error in the title:
Can not start your application The workgroup information file is absent or opened exclusively by another user.
I tried to do as suggested here, and added this
Jet OLEDB:System Database=system.mdw;
to connection string,
but I had a message saying that login or password is wrong.
Did somebody encounter the same error? How did you solve it?
Thanks