473,766 Members | 2,026 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MS Access DB used by both a local App and .net Web App

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 the database and
at that point I can no longer access the database with my web app. Is
there anyway around this? All I need is read only access to the
database to get some report information to display on the web page.

The error I get on the web app when I try to access the locked db is
"Could not use ''; file already in use."

Anyone have experiance with this?

Nov 19 '05 #1
16 1987
I found this thread but I didn't follow how the problem was fixed.
http://groups.google.com/group/micro...80ef822df6e91c

Nov 19 '05 #2
Well your problem is that Access is a single user database and sucks
somewhat for this type of scneario.

If all your doing is reporting (a read activity), copy the file when you
access it using asp.net to a temp file and read from that instead. That way
you should always have access and will get up to date data.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"JonnyD" <ma*********@gm ail.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
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 the database and
at that point I can no longer access the database with my web app. Is
there anyway around this? All I need is read only access to the
database to get some report information to display on the web page.

The error I get on the web app when I try to access the locked db is
"Could not use ''; file already in use."

Anyone have experiance with this?

Nov 19 '05 #3
I think my suggestion from 3 years ago still is good advice:

"Downloaded FileMon and took another look. Appears ASPNET didn't have the
rights I thought it did to the database and the folder it resides in. Fixed
that, and the problem cleared up"

The ASPNET user must have read/write access to the folder containing your
..mdb file.

Greg
"JonnyD" <ma*********@gm ail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I found this thread but I didn't follow how the problem was fixed.
http://groups.google.com/group/micro...80ef822df6e91c

Nov 19 '05 #4
I would like the data to be as real time as possable though, would it
be slow if i were to copy the db for every page refresh, or even
everytime a querry is run?

Nov 19 '05 #5
MS Access is weird. We run into this all the time on our network where we
want some users to have full rights to a database, and others have only read
rights. Turns out if the read-only people connect while a full-rights
person is connected they get "blocked"(! ) See, no matter what your rights
to the .mdb, you have to have full-rights to the .ldb (maybe even create it,
if it is not present) in order for Access to work properly. (Access suxs
for this, but wacha goin do).

The solution for multiple users on a network share is to place the .mdb file
in a folder. Permission the folder for with full-rights for everbody. Then
restricts rights to the .mdb file itself for the read-only folks. This
allows everybody to create/write the .ldb file. A nasty side effect is that
the read-only folks can create/write to any other files in the subfolder.
You cannot just permission the .ldb explicitly, because sometimes it get
deleted.

(There is a KB article on the above, I'll try and track it down._

OK. How does this apply to a web app...

If the .mdb was on the same server, you would just give the local ASPNET
user full rights to the folder that contains the .mdb. There, problem
solved. :)

Since you database is on a different server you have to do more. This is
what I do all time; "Pass-through authentication" .

The steps:
#1. Change the password for your ASPNET user on the webserver. (If will give
dire warnings, but just do it). Set it to something secret.
#2. Open machine.config on webserver. Fine the processModel section.
Change password from "autogenera te" to your new password.

Run iisreset to restart webserver (or just reboot webser). (If you ever
apply .dotnet SP1 or a future SP; it will reset the ASPNET password back to
some unknown, and things will break - cause it won't match what the
machine.config says. Just reset it again, and double check the account
didn't get lock out.)

Now ASP.NET is running on your webserver with the still limited user
account; ASPNET, but now with a known password. (that is the key to making
this work)

#3. On network share server, create a local account named "ASPNET". Make
password the same as above.
#4. Permission the folder containing your .mdb file on this server, so that
this local account has read-write access to the entire folder(!).

You could have made a domain account, and changed your webserver to run
using it instead. But then you would have to assign that domain account the
same rights as the local ASPNET user on the webserver for things to work
correctly. (That is tricky to do, and not necessary using pass-through).
There are KB on how to do this, but doesn't seem worth the hassel to me.

Added bonus: this method works also if you ever need to connect to SQL
Server running on another server than your webserver.

Let me know what you need cleared up. I'm typing pretty fast. :)

Greg

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:OB******** ******@TK2MSFTN GP15.phx.gbl...
I think my suggestion from 3 years ago still is good advice:

"Downloaded FileMon and took another look. Appears ASPNET didn't have the
rights I thought it did to the database and the folder it resides in.
Fixed
that, and the problem cleared up"

The ASPNET user must have read/write access to the folder containing your
.mdb file.

Greg
"JonnyD" <ma*********@gm ail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I found this thread but I didn't follow how the problem was fixed.
http://groups.google.com/group/micro...80ef822df6e91c


Nov 19 '05 #6
Here is the KB I mentioned:

http://support.microsoft.com/default...b;en-us;136128
Required Folder Permissions
If you plan to share a database, the .mdb file should be located in a folder
where users have read, write, create, and delete (or full control)
permissions. Even if you want users to have different file permissions (for
example, some read-only and some read-write), all users sharing a database
must have read, write, and create permissions to the folder. You can,
however, assign read-only permissions to the .mdb file for individual users
while still allowing full permissions to the folder.

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
MS Access is weird. We run into this all the time on our network where we
want some users to have full rights to a database, and others have only
read rights. Turns out if the read-only people connect while a
full-rights person is connected they get "blocked"(! ) See, no matter what
your rights to the .mdb, you have to have full-rights to the .ldb (maybe
even create it, if it is not present) in order for Access to work
properly. (Access suxs for this, but wacha goin do).

The solution for multiple users on a network share is to place the .mdb
file in a folder. Permission the folder for with full-rights for
everbody. Then restricts rights to the .mdb file itself for the read-only
folks. This allows everybody to create/write the .ldb file. A nasty side
effect is that the read-only folks can create/write to any other files in
the subfolder. You cannot just permission the .ldb explicitly, because
sometimes it get deleted.

(There is a KB article on the above, I'll try and track it down._

OK. How does this apply to a web app...

If the .mdb was on the same server, you would just give the local ASPNET
user full rights to the folder that contains the .mdb. There, problem
solved. :)

Since you database is on a different server you have to do more. This is
what I do all time; "Pass-through authentication" .

The steps:
#1. Change the password for your ASPNET user on the webserver. (If will
give dire warnings, but just do it). Set it to something secret.
#2. Open machine.config on webserver. Fine the processModel section.
Change password from "autogenera te" to your new password.

Run iisreset to restart webserver (or just reboot webser). (If you ever
apply .dotnet SP1 or a future SP; it will reset the ASPNET password back
to some unknown, and things will break - cause it won't match what the
machine.config says. Just reset it again, and double check the account
didn't get lock out.)

Now ASP.NET is running on your webserver with the still limited user
account; ASPNET, but now with a known password. (that is the key to making
this work)

#3. On network share server, create a local account named "ASPNET". Make
password the same as above.
#4. Permission the folder containing your .mdb file on this server, so
that this local account has read-write access to the entire folder(!).

You could have made a domain account, and changed your webserver to run
using it instead. But then you would have to assign that domain account
the same rights as the local ASPNET user on the webserver for things to
work correctly. (That is tricky to do, and not necessary using
pass-through). There are KB on how to do this, but doesn't seem worth the
hassel to me.

Added bonus: this method works also if you ever need to connect to SQL
Server running on another server than your webserver.

Let me know what you need cleared up. I'm typing pretty fast. :)

Greg

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:OB******** ******@TK2MSFTN GP15.phx.gbl...
I think my suggestion from 3 years ago still is good advice:

"Downloaded FileMon and took another look. Appears ASPNET didn't have
the
rights I thought it did to the database and the folder it resides in.
Fixed
that, and the problem cleared up"

The ASPNET user must have read/write access to the folder containing your
.mdb file.

Greg
"JonnyD" <ma*********@gm ail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I found this thread but I didn't follow how the problem was fixed.
http://groups.google.com/group/micro...80ef822df6e91c



Nov 19 '05 #7
"John Timney ( MVP )" <ti*****@despam med.com> wrote in message
news:uE******** ******@tk2msftn gp13.phx.gbl...
Well your problem is that Access is a single user database
That simply isn't true...
http://office.microsoft.com/en-gb/as...408601033.aspx
and sucks somewhat for this type of scneario.


That, however, is perfectly true.
Nov 19 '05 #8
"JonnyD" <ma*********@gm ail.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Anyone have experiance with this?


Yes, and you're not going to like the answer.

Put simply, an Access database is *totally* unsuited to what you're trying
to do with it, for several reasons:

1) Although the Jet engine is inherently multi-user, it is a desktop
database engine, not a server database engine. This means that all queries
run on the client, not the server.

2) Whenever an Access database is opened, a corresponding locking file (e.g.
Northwind.ldb) is created with the same name and in the same folder as the
database. This means that every user of the database needs to have,
essentially, full control permissions on the network folder.

3) Access databases restrict the number of concurrent connections from IIS -
I can't remember exactly what that figure is, but it's quite low.

4) If you have the Access application installed on your desktop and,
inadvertently or even intentionally, open a database as "Exclusive" (e.g. to
do some maintenance or whatever), Access will remember that setting and will
always subsequently open that database as Exclusive until you explicitly
tell it not to, thereby preventing any other user from connecting to it.
Do yourself a huge favour and use SQL Server / MSDE / mySql...
Nov 19 '05 #9
A caveat and some info...

re:
This means that every user of the database needs to have, essentially, full control
permissions on the network folder.
In a anonymous-access web application there's only one user.

re: 3) Access databases restrict the number of concurrent connections from IIS - I can't
remember exactly what that figure is, but it's quite low.
I've run web applications with a sustained 60+
concurrent connections without a problem.

Fine-tuning your connections ( releasing them
as soon as you're done with them ) helps a lot.

re: Do yourself a huge favour and use SQL Server / MSDE / mySql...
MSDE will outperform Access on the web, and mySql
will vastly outperform Access on the web, and SQL Server will
outperform all of them.

Something to keep in mind is that SQL Server Express is already
available at MSDN Subscriber downloads and will be released
to the general public in less than 10 days.

It will easily outperform MSDE and give mySql a run for its money
....and it's free.

For a desktop application with less than 60 concurrent users,
however, Access is a fine solution which offers many advantages
and built-in resources.


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/
=============== =============== ========
"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:OX******** ******@TK2MSFTN GP09.phx.gbl... "JonnyD" <ma*********@gm ail.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Anyone have experiance with this?


Yes, and you're not going to like the answer.

Put simply, an Access database is *totally* unsuited to what you're trying to do with
it, for several reasons:

1) Although the Jet engine is inherently multi-user, it is a desktop database engine,
not a server database engine. This means that all queries run on the client, not the
server.

2) Whenever an Access database is opened, a corresponding locking file (e.g.
Northwind.ldb) is created with the same name and in the same folder as the database.
This means that every user of the database needs to have, essentially, full control
permissions on the network folder.

3) Access databases restrict the number of concurrent connections from IIS - I can't
remember exactly what that figure is, but it's quite low.

4) If you have the Access application installed on your desktop and, inadvertently or
even intentionally, open a database as "Exclusive" (e.g. to do some maintenance or
whatever), Access will remember that setting and will always subsequently open that
database as Exclusive until you explicitly tell it not to, thereby preventing any other
user from connecting to it.
Do yourself a huge favour and use SQL Server / MSDE / mySql...

Nov 19 '05 #10

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

Similar topics

8
2958
by: Frnak McKenney | last post by:
Back when computer dinosaurs roamed the earth and the precursors to today's Internet were tiny flocks of TDMs living symbiotically with the silicon giants, tracking access to data processing resources was much simpler: you logged in with a userID and password, and when you were done you ended your session by logging out (or occasionally by being disconnected). Connection time was easy to measure, and it made sense to both the customer...
13
13354
by: Simon Bailey | last post by:
I am a newcomer to databases and am not sure which DBMS to use. I have a very simplified knowledge of databases overall. I would very much appreciate a (simplifed) message explaining the advantages and disadvantages of both programs. Many Thanks Simon
6
1555
by: user451 | last post by:
As the most Access-savvy person in my office, I have been handed the task of proposing a nationwide expansion of a project that I have developed in Access. A brief overview: Right now, about 25 people process about 5 transactions per day. (Total, not each) The back-end database resides on a server not located in my office, but nearby. The transactions are the results of certain law enforcement activities. Pretty low volume for new...
6
3886
by: John | last post by:
Hi We have an access app (front-end+backend) running on the company network. I am trying to setup replication for laptop users who go into field and need the data synched between their laptops and the server upon return to the office. I am planning it this; Move all access tables to sql server and then link the tables to access front-end mdb app (using odbc?). Copy the same setup (access front end + sql backend) onto each laptop....
64
5260
by: John | last post by:
Hi What future does access have after the release of vs 2005/sql 2005? MS doesn't seem to have done anything major with access lately and presumably hoping that everyone migrates to vs/sql. Any comments? Thanks
0
3292
by: bettervssremoting | last post by:
To view the full article, please visit http://www.BetterVssRemoting.com Better VSS Remote Access Tool including SourceOffSite, SourceAnyWhere and VSS Remoting This article makes a detailed comparison among SourceAnyWhere, SourceOffSite, VSS Remoting and possible others.
21
10832
by: Kevin Swanson | last post by:
I'm attempting some remote registry manipulation via C#. I've written a test app to simply grab a specified key from a specified hive on a specified machine. The call to OpenSubKey is throwing System.SecurityException. Also of note: Sitting at my local box, I can open regedit and connect to the remote registry. I see three hives: _CLASSES_ROOT, _LOCAL_MACHINE, and _USERS. I can open all but HKEY_LOCAL_MACHINE. When I try to expand that...
17
2496
by: DaveG | last post by:
Hi all I am planning on writing a stock and accounts program for the family business, I understand this is likely to take close to 2 years to accomplish. The stock is likely to run into over a thousand items and the accounting side will be used for hopefully many years so the entries are likely to be vast. The delema is what is best to use ase the DB engine, Access I have as part of Office 2002 or should I really be looking at SQL...
52
9981
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server 2005, and, since he already has licenses for Office Pro 2002, he wants to upgrade to that. I've been saying that we need to upgrade to Access 2003, not 2002, even if Office is kept at 2002. We are also looking to do a fair amount of...
0
1343
by: Nymus | last post by:
I would like to use an access database as a shared database on a remote website. I don't know if it is possible, but this is what i would like to do with this database: - Use it to run a database driven website - Maintain it via a client application and via the website. As i would like to maintain it both locally and remote via website forms written in ASP, I don't want to sync the information between the server and a client database. I...
0
9568
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
9404
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,...
0
10168
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10008
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9837
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
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6651
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
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3929
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

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.