Using Access with C#.NET

  • Thread starter Thread starter Curt Emich
  • Start date Start date
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.
 
¤ 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)
 
Back
Top