Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not start your application The workgroup information file is absent or opened exclusively by another user

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

like image 517
mStudent Avatar asked Nov 24 '25 11:11

mStudent


1 Answers

This can also be caused by a password in the connection string when the database isn't using a password.

like image 173
JasperJustice Avatar answered Nov 27 '25 00:11

JasperJustice



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!