473,651 Members | 2,566 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot open an access database from within an ASP.NET application

Hello:

When I tried to use an Access database, I get the following exception:

Server Error in '/WebGrid' Application.
--------------------------------------------------------------------------------

The Microsoft Jet database engine cannot open the file 'D:\Program
Files\Infragist ics\NetAdvantag e 2005 Volume
2\ASP.NET\Sampl es\Data\sampleb rowser.mdb'. It is already opened exclusively
by another user, or you need permission to view its data.

I made sure that the folder, Data, has full access to these two accouhts,
<machine_name>\ aspnet and <machine_Name>\ IWAM_machine_na me

Can somebody tell me how I can resolve this issue? Thanks.

Venki
Nov 19 '05 #1
10 2125
1)
Is the database open?
If you have the database open in Access, you will get this exception.
So if you have the database open, close it and try again.

2)
If your sure you don't have the database open, check that its closed
properly.
When you open an Access database file for editing, it create a temp file
called "samplebrowser. idb".
When you close the database, that file disapears.
If its still there, the database may have not closed properly, try closing
it again

3) Lastly

Try setting persmissions to IUSR_<machine_n ame>,
thats the user IIS uses.
If you not sure, set full permissions to everyone just incase

HTH

"vvenk" <vv***@discussi ons.microsoft.c om> wrote in message
news:C1******** *************** ***********@mic rosoft.com...
Hello:

When I tried to use an Access database, I get the following exception:

Server Error in '/WebGrid' Application.
--------------------------------------------------------------------------------

The Microsoft Jet database engine cannot open the file 'D:\Program
Files\Infragist ics\NetAdvantag e 2005 Volume
2\ASP.NET\Sampl es\Data\sampleb rowser.mdb'. It is already opened
exclusively
by another user, or you need permission to view its data.

I made sure that the folder, Data, has full access to these two accouhts,
<machine_name>\ aspnet and <machine_Name>\ IWAM_machine_na me

Can somebody tell me how I can resolve this issue? Thanks.

Venki

Nov 19 '05 #2
Folder & File.
Also, check your IIS settings, are you using anonymous or integrated
security? That determins the user you need to set for permissions.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"vvenk" wrote:
Hello:

When I tried to use an Access database, I get the following exception:

Server Error in '/WebGrid' Application.
--------------------------------------------------------------------------------

The Microsoft Jet database engine cannot open the file 'D:\Program
Files\Infragist ics\NetAdvantag e 2005 Volume
2\ASP.NET\Sampl es\Data\sampleb rowser.mdb'. It is already opened exclusively
by another user, or you need permission to view its data.

I made sure that the folder, Data, has full access to these two accouhts,
<machine_name>\ aspnet and <machine_Name>\ IWAM_machine_na me

Can somebody tell me how I can resolve this issue? Thanks.

Venki

Nov 19 '05 #3
Curt:

In the website's security setting, Enable_Anonymou s_Access is checked and
the it uses the account IUSER_<machine_ Name> for access. And, I made sure
that this account has full access rights.

Also, Integrated Windows Authentication is checked as well.

Venki

"Curt_C [MVP]" wrote:
Folder & File.
Also, check your IIS settings, are you using anonymous or integrated
security? That determins the user you need to set for permissions.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"vvenk" wrote:
Hello:

When I tried to use an Access database, I get the following exception:

Server Error in '/WebGrid' Application.
--------------------------------------------------------------------------------

The Microsoft Jet database engine cannot open the file 'D:\Program
Files\Infragist ics\NetAdvantag e 2005 Volume
2\ASP.NET\Sampl es\Data\sampleb rowser.mdb'. It is already opened exclusively
by another user, or you need permission to view its data.

I made sure that the folder, Data, has full access to these two accouhts,
<machine_name>\ aspnet and <machine_Name>\ IWAM_machine_na me

Can somebody tell me how I can resolve this issue? Thanks.

Venki

Nov 19 '05 #4
I never meant just in case --> " If you not sure, set full permissions to
everyone just incase"

I meant Just to TEST

"Grant Merwitz" <gr***@workshar e.com> wrote in message
news:OK******** ******@TK2MSFTN GP09.phx.gbl...
1)
Is the database open?
If you have the database open in Access, you will get this exception.
So if you have the database open, close it and try again.

2)
If your sure you don't have the database open, check that its closed
properly.
When you open an Access database file for editing, it create a temp file
called "samplebrowser. idb".
When you close the database, that file disapears.
If its still there, the database may have not closed properly, try closing
it again

3) Lastly

Try setting persmissions to IUSR_<machine_n ame>,
thats the user IIS uses.
If you not sure, set full permissions to everyone just incase

HTH

"vvenk" <vv***@discussi ons.microsoft.c om> wrote in message
news:C1******** *************** ***********@mic rosoft.com...
Hello:

When I tried to use an Access database, I get the following exception:

Server Error in '/WebGrid' Application.
--------------------------------------------------------------------------------

The Microsoft Jet database engine cannot open the file 'D:\Program
Files\Infragist ics\NetAdvantag e 2005 Volume
2\ASP.NET\Sampl es\Data\sampleb rowser.mdb'. It is already opened
exclusively
by another user, or you need permission to view its data.

I made sure that the folder, Data, has full access to these two accouhts,
<machine_name>\ aspnet and <machine_Name>\ IWAM_machine_na me

Can somebody tell me how I can resolve this issue? Thanks.

Venki


Nov 19 '05 #5
Grant:

When I gave the account, Everybody, Full Control, it worked. Now, I have to
figure out who really needs that level of access.

Thanks.

"Grant Merwitz" wrote:
1)
Is the database open?
If you have the database open in Access, you will get this exception.
So if you have the database open, close it and try again.

2)
If your sure you don't have the database open, check that its closed
properly.
When you open an Access database file for editing, it create a temp file
called "samplebrowser. idb".
When you close the database, that file disapears.
If its still there, the database may have not closed properly, try closing
it again

3) Lastly

Try setting persmissions to IUSR_<machine_n ame>,
thats the user IIS uses.
If you not sure, set full permissions to everyone just incase

HTH

"vvenk" <vv***@discussi ons.microsoft.c om> wrote in message
news:C1******** *************** ***********@mic rosoft.com...
Hello:

When I tried to use an Access database, I get the following exception:

Server Error in '/WebGrid' Application.
--------------------------------------------------------------------------------

The Microsoft Jet database engine cannot open the file 'D:\Program
Files\Infragist ics\NetAdvantag e 2005 Volume
2\ASP.NET\Sampl es\Data\sampleb rowser.mdb'. It is already opened
exclusively
by another user, or you need permission to view its data.

I made sure that the folder, Data, has full access to these two accouhts,
<machine_name>\ aspnet and <machine_Name>\ IWAM_machine_na me

Can somebody tell me how I can resolve this issue? Thanks.

Venki


Nov 19 '05 #6
To find out which account needs access permission,
save the following as identity.aspx and run it.

identity.aspx
-------------------
<%@ Page Language="VB" %>
<%@ Import NameSpace = System.Security .Principal %>
<script runat="server">
Sub Page_Load()
Dim tmp As String = WindowsIdentity .GetCurrent.Nam e()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsI dentity.GetCurr ent.Name()</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
------------------

When you run that file, it will return the current ASP.NET identity,
i.e., the account ASP.NET is running as.

Give *that* account the access permissions to the directory and file.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"vvenk" <vv***@discussi ons.microsoft.c om> wrote in message
news:F8******** *************** ***********@mic rosoft.com...
Curt:

In the website's security setting, Enable_Anonymou s_Access is checked and
the it uses the account IUSER_<machine_ Name> for access. And, I made sure
that this account has full access rights.

Also, Integrated Windows Authentication is checked as well.

Venki

"Curt_C [MVP]" wrote:
Folder & File.
Also, check your IIS settings, are you using anonymous or integrated
security? That determins the user you need to set for permissions.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"vvenk" wrote:
> Hello:
>
> When I tried to use an Access database, I get the following exception:
>
> Server Error in '/WebGrid' Application.
> --------------------------------------------------------------------------------
>
> The Microsoft Jet database engine cannot open the file 'D:\Program
> Files\Infragist ics\NetAdvantag e 2005 Volume
> 2\ASP.NET\Sampl es\Data\sampleb rowser.mdb'. It is already opened exclusively
> by another user, or you need permission to view its data.
>
> I made sure that the folder, Data, has full access to these two accouhts,
> <machine_name>\ aspnet and <machine_Name>\ IWAM_machine_na me
>
> Can somebody tell me how I can resolve this issue? Thanks.
>
> Venki

Nov 19 '05 #7
Juan:

Thank you so much for thsi jewel. I came to know that Network Services needs
to have full control on this folder.

Venki

"Juan T. Llibre" wrote:
To find out which account needs access permission,
save the following as identity.aspx and run it.

identity.aspx
-------------------
<%@ Page Language="VB" %>
<%@ Import NameSpace = System.Security .Principal %>
<script runat="server">
Sub Page_Load()
Dim tmp As String = WindowsIdentity .GetCurrent.Nam e()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsI dentity.GetCurr ent.Name()</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
------------------

When you run that file, it will return the current ASP.NET identity,
i.e., the account ASP.NET is running as.

Give *that* account the access permissions to the directory and file.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"vvenk" <vv***@discussi ons.microsoft.c om> wrote in message
news:F8******** *************** ***********@mic rosoft.com...
Curt:

In the website's security setting, Enable_Anonymou s_Access is checked and
the it uses the account IUSER_<machine_ Name> for access. And, I made sure
that this account has full access rights.

Also, Integrated Windows Authentication is checked as well.

Venki

"Curt_C [MVP]" wrote:
Folder & File.
Also, check your IIS settings, are you using anonymous or integrated
security? That determins the user you need to set for permissions.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"vvenk" wrote:

> Hello:
>
> When I tried to use an Access database, I get the following exception:
>
> Server Error in '/WebGrid' Application.
> --------------------------------------------------------------------------------
>
> The Microsoft Jet database engine cannot open the file 'D:\Program
> Files\Infragist ics\NetAdvantag e 2005 Volume
> 2\ASP.NET\Sampl es\Data\sampleb rowser.mdb'. It is already opened exclusively
> by another user, or you need permission to view its data.
>
> I made sure that the folder, Data, has full access to these two accouhts,
> <machine_name>\ aspnet and <machine_Name>\ IWAM_machine_na me
>
> Can somebody tell me how I can resolve this issue? Thanks.
>
> Venki


Nov 19 '05 #8
re:
Thank you so much for this jewel.
You're very much welcome, wenk.

I wrote that script, in desperation, after butting my head against
the wall for hours with exactly the same problem you were having.

It sure makes configuring ASP.NET permissions easier, doesn't it ?

;-)

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"vvenk" <vv***@discussi ons.microsoft.c om> wrote in message
news:51******** *************** ***********@mic rosoft.com... Juan:

Thank you so much for thsi jewel. I came to know that Network Services needs
to have full control on this folder.

Venki

"Juan T. Llibre" wrote:
To find out which account needs access permission,
save the following as identity.aspx and run it.

identity.aspx
-------------------
<%@ Page Language="VB" %>
<%@ Import NameSpace = System.Security .Principal %>
<script runat="server">
Sub Page_Load()
Dim tmp As String = WindowsIdentity .GetCurrent.Nam e()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsI dentity.GetCurr ent.Name()</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
------------------

When you run that file, it will return the current ASP.NET identity,
i.e., the account ASP.NET is running as.

Give *that* account the access permissions to the directory and file.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
=============== =============== ========
"vvenk" <vv***@discussi ons.microsoft.c om> wrote in message
news:F8******** *************** ***********@mic rosoft.com...
> Curt:
>
> In the website's security setting, Enable_Anonymou s_Access is checked and
> the it uses the account IUSER_<machine_ Name> for access. And, I made sure
> that this account has full access rights.
>
> Also, Integrated Windows Authentication is checked as well.
>
> Venki
>
> "Curt_C [MVP]" wrote:
>
>> Folder & File.
>> Also, check your IIS settings, are you using anonymous or integrated
>> security? That determins the user you need to set for permissions.
>> --
>> Curt Christianson
>> site: http://www.darkfalz.com
>> blog: http://blog.darkfalz.com
>>
>>
>>
>> "vvenk" wrote:
>>
>> > Hello:
>> >
>> > When I tried to use an Access database, I get the following exception:
>> >
>> > Server Error in '/WebGrid' Application.
>> > --------------------------------------------------------------------------------
>> >
>> > The Microsoft Jet database engine cannot open the file 'D:\Program
>> > Files\Infragist ics\NetAdvantag e 2005 Volume
>> > 2\ASP.NET\Sampl es\Data\sampleb rowser.mdb'. It is already opened exclusively
>> > by another user, or you need permission to view its data.
>> >
>> > I made sure that the folder, Data, has full access to these two accouhts,
>> > <machine_name>\ aspnet and <machine_Name>\ IWAM_machine_na me
>> >
>> > Can somebody tell me how I can resolve this issue? Thanks.
>> >
>> > Venki

Nov 19 '05 #9
Juan,

This aspx file is marvelous, it helped me a lot. Thank you very much.

Sabine

Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
10949
by: bailee220 | last post by:
I have included the following code to open an Access database form from within an exsisting Access database. But when I run the code, it appears that it opens the database because in windows explorer I can see the database has the .ldb file extension. So it appears that it's open, but I can't see the database or the form that I've tried to open. What am I doing wrong. The following is the code: 'This is in the declaration part of...
2
4309
by: plau011 | last post by:
Hello Access gurus, I am curious as to why you can't open an Access 2003 Db with Access 2000. We have a Visual Basic application which is using DAO 3.6 to connect to the Access database. It IS able to open an 2000 and 2003 Db because they are all in Jet 4 database format, I assume. But when trying to open an Access 2003 Db from Access 2000 you get the 'Unrecognized database' Error. Aren't they the same database structure and the only...
3
4277
by: POL8985 | last post by:
The application is developed in ASP.Net with a SQL Server database. Essentially, the application uses a single shared Connection object for all users logged into the system. The connection object is opened/closed for each transaction. The error - System.IndexOutOfRangeException: Cannot find table 0 - occurs on one page that accepts a single piece of data from a textbox. This data is then passed to the business logic classes (in...
3
3289
by: Jim in Arizona | last post by:
I have a gridview that's being populated from an access db query. The problem I'm having is that the date/time fields in access that are populating the gridview are showing both date and time, when the field should only be showing one or the other (date or time). Even on the back end of the database where the column properties are, I have chosen the smallest date/time formats. When the aspx page runs, it shows the date and time (ie:in a...
4
4612
by: snow | last post by:
Hi all, I have a VB.net program installed in a xp home with sp2,after installation, get error "Cannot open a database from a previous version of your application. The database is a 97 Access file. Could someone tell me what cause this problem? Thanks for your help!
2
2329
by: bbasberg | last post by:
I have been working hard to clean up my code but I am still wondering why all incoming records go to the "AddNew" part of the IF statement and never to the Edit alternative. I believe that it must be because my rs.index never really receives the value from the cell in the spreadsheet that it should use to compare to the corresponding field in the Access DB. I have named the field "rtitle" in Access and made it an index called riskIndex. I am an...
5
9465
by: Ian | last post by:
I am trying to: 1. Open a form on the external database 2. Enter a value in a text box on that form I have 1 above working OK using module form “The Access Web”, the module looks like this: ************ Code Start ************* ' This code was originally written by Dev Ashish.
1
1688
by: martinbr_2000 | last post by:
I have an access database that has been split and resides in the network share. When the access database is currently being updated by someone, and I try to open the database, I cannot open the file by double clicking on the database filename, for example, \\sharename\testdb.mdb I have to launch MS access, go to the file, then open the file from within MS Access.
14
4625
by: SimeonD | last post by:
Hi I have an access database called Sales.Mdb In vb.net 2005, I'd like to open it. Which I can do. What I can't figure out is how to figure out if Sales.Mdb is open already. If so, I want to open that instance. Any ideas how I would do this? Thanks
0
8352
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8579
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2699
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1909
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1587
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.