473,387 Members | 3,684 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Access Database exclusively locked - NOT

Hi,

I;m a newbie trying to get through some examples in VS2003. I'm trying
to open a small Access database using ADO.NET in an ASP.NET app usinig
an oleDBConnection. I get the following error when openning the
database:

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

The file is not opened or locked by anoyone else as far as I can tell.
This also happens when I'm running outside of the IDE with VS shut
down.

Can I get a little help on this please?

TIA.

Curt

Nov 16 '05 #1
8 4242
Curt,

If you are sure that no one else is running it, are you sure that you
have the appropriate permissions? Not only in the file system, but with the
database itself? The MDB can be password protected, in which case, you have
to provide that in the connect string.

If that is not the case, can you post a piece of sample code and the MDB
so that we can try it?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"ACE FAN" <ct****@oneil.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Hi,

I;m a newbie trying to get through some examples in VS2003. I'm trying
to open a small Access database using ADO.NET in an ASP.NET app usinig
an oleDBConnection. I get the following error when openning the
database:

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

The file is not opened or locked by anoyone else as far as I can tell.
This also happens when I'm running outside of the IDE with VS shut
down.

Can I get a little help on this please?

TIA.

Curt

Nov 16 '05 #2
Nicholas,
I am sure no one else is running it- it's just a little 3 table DB I
threw together myself so no one would even want to run it even if they
could. I can open it with Access just fine. I am using the default
Admin user and a blank password in my connection string.

-Curt

Nov 16 '05 #3
Oops, here's the code:
private void Page_Load(object sender, System.EventArgs e)
{
dbConn.Open();
Here's my connection string: (Test connection is successful at design
time connection strinig build)
this.dbConn.ConnectionString = @"Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Jet
OLEDB:Database Password=;Data
Source=""C:\Inetpub\wwwroot\Meeting1\Meeting1.mdb" ";Password=;Jet
OLEDB:Engine Type=5;Jet OLEDB:Global Bulk
Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0" ";Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny
None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System
Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet
OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet
OLEDB:Encrypt Database=False";

Thanks

Nov 16 '05 #4
Ahh, but you aren't running it, are you? This is code for the PageLoad
event handler in an ASP.NET page. By default, ASP.NET runs under the ASPNET
local account, which has limited access to the local machine. Unless you
changed it, it is trying to access it using a very limited permission set.

You would have to change it to run under a different account in order to
do this, or impersonate a user that has rights in the page itself.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"ACE FAN" <ct****@oneil.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Oops, here's the code:
private void Page_Load(object sender, System.EventArgs e)
{
dbConn.Open();
Here's my connection string: (Test connection is successful at design
time connection strinig build)
this.dbConn.ConnectionString = @"Jet OLEDB:Global Partial Bulk
Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Jet
OLEDB:Database Password=;Data
Source=""C:\Inetpub\wwwroot\Meeting1\Meeting1.mdb" ";Password=;Jet
OLEDB:Engine Type=5;Jet OLEDB:Global Bulk
Transactions=1;Provider=""Microsoft.Jet.OLEDB.4.0" ";Jet OLEDB:System
database=;Jet OLEDB:SFP=False;Extended Properties=;Mode=Share Deny
None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System
Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet
OLEDB:Compact Without Replica Repair=False;User ID=Admin;Jet
OLEDB:Encrypt Database=False";

Thanks

Nov 16 '05 #5
Thanks. I have changed the permissions of the ASPNET local account to
match my own (also set it to Administrator's group) but to no avail.
Should I, and how can I run the app as me instead of the ASPNET user?
Curt

Nov 16 '05 #6
Thanks. I have changed the permissions of the ASPNET local account to
match my own (also set it to Administrator's group) but to no avail.
Should I, and how can I run the app as me instead of the ASPNET user?
Curt

Nov 16 '05 #7
Curt,

Be careful, in practice, you should not run a web app with an ASPNET
account with elevated permissions.

There are two ways to impersonate someone else. The first is to place
the page in a directory, and then have the web.config file for that
directory have the <identity> tag, where the impersonate attribute is set to
true.

You can also do it in code, by calling the Impersonate method on the
WindowsIdentity class. Check the documentation on that method for more
information on how to do this.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"ACE FAN" <ct****@oneil.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Thanks. I have changed the permissions of the ASPNET local account to
match my own (also set it to Administrator's group) but to no avail.
Should I, and how can I run the app as me instead of the ASPNET user?
Curt

Nov 16 '05 #8
Thanks Nicholas. I got access and will now deal with the security
issue. . .

Nov 16 '05 #9

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

Similar topics

0
by: Allcomp | last post by:
Hello, I try to make a backup of a access database. To make it, I make a Filecopy, but some of my custommers have a problem : They work at 2 or 3 on the database, but when a user want to make a...
3
by: Karen | last post by:
I have a database built in Access that is on our Windows Server. We have a satellite office in Houston that uses Citrix to access our server. Here in the main office, we have 15 users that log...
3
by: Leinad Kong | last post by:
I'm using Access 2002, as front-end and back-end as well: 1) I faced database corrupted problems, when more than 1 user edit concurrently. I'm using All-records Locking, and open-exclusively as...
3
by: wandali | last post by:
When I want to edit a MS Database, I have to run the following command: "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "\\Server\Directory\File.mdb" /wrkgrp...
18
by: Andre Laplume via AccessMonster.com | last post by:
I have inherited a bunch of dbs which are are shared among a small group in my dept. We typically use the dbs to write queries to extract data, usually dumping it into Excel. Most dbs originated...
4
by: db1 | last post by:
I want to modify the design of some forms and do some other things that I need to have the db opened exclusively in order to accomplish. Someone has Access open, but have locked their machine...
4
by: et | last post by:
I have an aspnet program that uses an Access database -- I won't go into why I'm using Access -- and can't get it to run in share mode. If I have opened the website, and I try to edit the...
16
by: JonnyD | last post by:
I am working on a project to build a reporting web app from an exsiting database that is controled by a local application. The application that has control over the database creates a lock file to...
2
by: siewong | last post by:
Existing Access Database Troubleshooting I am new to access database and inherited an access application and all users who were previously able to use this access file simulataneously are now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.