Error Opening Database (Using DataGrid)

  • Thread starter Thread starter OutdoorGuy
  • Start date Start date
O

OutdoorGuy

Greetings,

I am receiving the following error message when I try to run a sample
application that I've created:

"The Microsoft Jet database engine cannot open the file
'C:\MYDATA\Sports.mdb'. It is already opened exclusively by another
user, or you need permission to view its data."

I have verified that the database is not in use by another application.
Also, it is not marked as "Read-Only". Additionally, I have made the
"ASPNET" machine account a member of the Power Users group.

On my web page I am using a data grid and have the following code in the
"Page_Load" event of the page. By the way, the error message occurs on
the "this.oleDbDataAdapter1.Fill" line of code:

private void Page_Load(object sender, System.EventArgs e)
{
if (! IsPostBack)
{
this.oleDbDataAdapter1.Fill(dsMembers11);
this.DataBind();
}
}

Any suggestions on what else I could try?

Thanks in advance!
 
OutdoorGuy:

I would look at the permissions on the .mdb file and make sure the anonymous
user specified in IIS (whether that is the ASPNET account, or another) has
permissions to the file.

Second, I would check the security permissions in Access for the table or
object you are querying to see if the Admin (or other account) has
permissions on the table (or object).

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.
 
Greetings,

I am receiving the following error message when I try to run a sample
application that I've created:

"The Microsoft Jet database engine cannot open the file
'C:\MYDATA\Sports.mdb'. It is already opened exclusively by another
user, or you need permission to view its data."

I have verified that the database is not in use by another application.
Also, it is not marked as "Read-Only". Additionally, I have made the
"ASPNET" machine account a member of the Power Users group.

On my web page I am using a data grid and have the following code in the
"Page_Load" event of the page. By the way, the error message occurs on
the "this.oleDbDataAdapter1.Fill" line of code:

private void Page_Load(object sender, System.EventArgs e)
{
if (! IsPostBack)
{
this.oleDbDataAdapter1.Fill(dsMembers11);
this.DataBind();
}
}

Any suggestions on what else I could try?

Thanks in advance!


Try setting the permissions on the MDB file to allow all access for
"Everyone". You might not want to leave it that way in the long run,
(for security reasons), but setting it that way for this test will
tell you if it's a permissions problem.

If that makes the error go away, then you'll just need to figure out
what user account (IUSR_MACHINE?) is trying to access the file and set
the permissions accordingly for that user or group.
 
goody8 said:
Try setting the permissions on the MDB file to allow all access for
"Everyone". You might not want to leave it that way in the long run,
(for security reasons), but setting it that way for this test will
tell you if it's a permissions problem.

If that makes the error go away, then you'll just need to figure out
what user account (IUSR_MACHINE?) is trying to access the file and set
the permissions accordingly for that user or group.

It also used to be the case that you needed permission to create an .ldb
file in the same directory. I don't know whether Access still works that
way.
 
Back
Top