Connecting Tech Pros Worldwide Forums | Help | Site Map

Error Opening Database (Using DataGrid)

OutdoorGuy
Guest
 
Posts: n/a
#1: Nov 17 '05
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!




*** Sent via Developersdex http://www.developersdex.com ***

David Lloyd
Guest
 
Posts: n/a
#2: Nov 17 '05

re: Error Opening Database (Using DataGrid)


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.


"OutdoorGuy" <OutdoorGuy@fishing.com> wrote in message
news:#TnZFoOUFHA.3392@TK2MSFTNGP12.phx.gbl...[color=blue]
> 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!
>
>
>
>
> *** Sent via Developersdex http://www.developersdex.com ***[/color]


goody8
Guest
 
Posts: n/a
#3: Nov 17 '05

re: Error Opening Database (Using DataGrid)


On Wed, 04 May 2005 13:44:07 -0700, OutdoorGuy
<OutdoorGuy@fishing.com> wrote:
[color=blue]
>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!
>[/color]


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.



Steve Walker
Guest
 
Posts: n/a
#4: Nov 17 '05

re: Error Opening Database (Using DataGrid)


In message <c1fi7158ps5s095k6fm2puv2h8k6gs22dm@4ax.com>, goody8
<goody8@goody8.com> writes
[color=blue]
>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.[/color]

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.

--
Steve Walker
OutdoorGuy
Guest
 
Posts: n/a
#5: Nov 17 '05

re: Error Opening Database (Using DataGrid)


Any idea as to how to determine who the anonymous user is in IIS?

Thanks!



*** Sent via Developersdex http://www.developersdex.com ***
Closed Thread