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.
 
Any idea as to how to determine who the anonymous user is in IIS?

Thanks!
 

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

Similar Threads

Cant Connect to Data base 7
BindingContext problems 1
Can not open the database; VS.net 2002/Framework 1.0/IIS 5.1 1
DataGrid Paging 1
Databases in sql 3
Asp repeater & LinkButton 2
Datagrid error 1
Event Args 6

Back
Top