Using Access with C#.NET

C

Curt Emich

I'm tyring to use MS Access with .NET, but I'm having some problems. Here's
the code:



string sSQL = "SELECT Statement_Id,Statement_In_Brief FROM Statements";

OleDbDataAdapter thisAdapter = new OleDbDataAdapter(sSQL,oleDbConnection1);

DataSet thisDataset = new DataSet();

thisAdapter.Fill(thisDataset,"Statements");



It bombs on the 4th line. I get the error message, "

The Microsoft Jet database engine cannot open the file
'C:\Inetpub\wwwroot\TrainOfThought\data\TrainOfThought.mdb'. It is already
opened exclusively by another user, or you need permission to view its data.
It is not opened by another user, etc. Something else is going on. Does
anyone have any ideas as to what that might be? Thanks in advance for your
help.
 
P

Paul Clement

¤ I'm tyring to use MS Access with .NET, but I'm having some problems. Here's
¤ the code:
¤
¤
¤
¤ string sSQL = "SELECT Statement_Id,Statement_In_Brief FROM Statements";
¤
¤ OleDbDataAdapter thisAdapter = new OleDbDataAdapter(sSQL,oleDbConnection1);
¤
¤ DataSet thisDataset = new DataSet();
¤
¤ thisAdapter.Fill(thisDataset,"Statements");
¤
¤
¤
¤ It bombs on the 4th line. I get the error message, "
¤
¤ The Microsoft Jet database engine cannot open the file
¤ 'C:\Inetpub\wwwroot\TrainOfThought\data\TrainOfThought.mdb'. It is already
¤ opened exclusively by another user, or you need permission to view its data.
¤ It is not opened by another user, etc. Something else is going on. Does
¤ anyone have any ideas as to what that might be? Thanks in advance for your
¤ help.

Very likely a permissions issue. Make certain that you have Read, Write, Create, and Modify
permissions to the folder where the database is located.

If this is web app you will probably need to provide these permissions to the ASPNET account,
although it will also depend upon what type of authentication you are using for your ASP.NET
application.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top