473,508 Members | 4,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help connecting to Access DB from web service

I am creating a web service that returns data from an Access 2000 database
using VS2005. The Access database is located on a different server than
where the web service is running. The Access database is also opened by a
different desktop application running on various workstations on the
network.

While developing / debugging the web service is hosted on my development
machine using the 'ASP.NET Development Server' that is included with VS2005.
When deployed it is being host with IIS.

I am using the following connection string:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source="\\slo-science1\data\PBI Chem
data\PBIChemDatabase.mdb"

If the database has NOT opened by any of the workstations running the
desktop application then the web service runs correctly on both my
development machine as well as on the IIS server.

If the database has been opened by any of the workstations running the
desktop application the web service runs correctly ONLY on my development
machine and fails on IIS with the following error:

System.Data.OleDb.OleDbException: Could not use ''; file already in use.

What are the differences between the 'ASP.NET Development Server' and IIS
that would effect how a web service opens a remote Access database?

Does anyone know how what settings can be changed so that the web service
runs correctly on IIS?

Thanks in advance,
Jeff Richardson
Apr 1 '06 #1
5 2294
Hi Jeff,

Welcome to the MSDN newsgroup.

Regarding on the accessing Access mdb database in ASP.NET application, it
is likely the ASP.NET application doesn't have sufficient permission or the
mdb file is locked. From your description, you've another desktop
application that will also open and access the mdb file, if so, I'm afraid
the ASP.NET application hosted in IIS will not be able to access it
concurently (if get locked). This is different when accessing from local
computer or in testserver because when deploying in IIS, the asp.net
appliation runs under the asp.net worker process (under the worker proces
indenitity) and this process's security session is not a interactive
session which can not perform many action like desktop application. So for
your scenario, I think you may consider the following options:

1. Do not make other application access the same mdb file concurrently that
make it get locked.

2. Use SQL express db instead, this is also file based however is designed
for concorrent server-side application and has much better performance
against access.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Apr 3 '06 #2
Hello Steve,

Thank you for your reply.

I would love to move the database to SQL Express but that is not an option
since the desktop application is a comerical application and its native file
format is Access.

Given that I can not move the data to a better database, what can be done to
make my web service work well with the Access db while hosted on IIS? Can
the worker process for this application be given additional permission?

Thanks,
Jeff.
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:dD**************@TK2MSFTNGXA01.phx.gbl...
Hi Jeff,

Welcome to the MSDN newsgroup.

Regarding on the accessing Access mdb database in ASP.NET application, it
is likely the ASP.NET application doesn't have sufficient permission or
the
mdb file is locked. From your description, you've another desktop
application that will also open and access the mdb file, if so, I'm
afraid
the ASP.NET application hosted in IIS will not be able to access it
concurently (if get locked). This is different when accessing from local
computer or in testserver because when deploying in IIS, the asp.net
appliation runs under the asp.net worker process (under the worker proces
indenitity) and this process's security session is not a interactive
session which can not perform many action like desktop application. So
for
your scenario, I think you may consider the following options:

1. Do not make other application access the same mdb file concurrently
that
make it get locked.

2. Use SQL express db instead, this is also file based however is
designed
for concorrent server-side application and has much better performance
against access.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 3 '06 #3
Thanks for your response Jeff,

After some further research, If you do have to use the Access as the
datastorage which will be accessed by multiple processes, you need to take
care of the following things:

1. Since your mdb file is put on a fileshare, make sure you've grant
sufficient permission in both the fileshare and the NTFS's permission
setting. In my test case I grant both of them everyone full control though
you can adjust them according to your decent scenario.

2. In the OLEDB connectionstring, specify the connection mode as
"Mode=Share Deny None", this means that the connection to the db file won't
lock it and won't deny any type of access from other client/process(read,
write....). e.g here is the connectionstring generated through the VS ide
connection wizard:(used in my desktop application)

========================
Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=1;Data
Source="D:\Share_Data\mydb.mdb";Mode=Share Deny None;Jet OLEDB:Engine
Type=5;Provider="Microsoft.Jet.OLEDB.4.0";Jet OLEDB:System database=;Jet
OLEDB:SFP=False;persist security info=False;Extended Properties=;Jet
OLEDB:Compact Without Replica Repair=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy
Locale on Compact=False;User ID=Admin;Jet OLEDB:Global Bulk Transactions=1
========================

Then, in our ASP.NET application, just use the same connection setting to
access the mdb file(through remote file share). Based on my local test, it
works correctly(I can access it well in both desktop & asp.net application
concurrently).

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 4 '06 #4
Thanks Steven,

Permissions was the source of my troubles.

Jeff.
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:1g****************@TK2MSFTNGXA01.phx.gbl...
Thanks for your response Jeff,

After some further research, If you do have to use the Access as the
datastorage which will be accessed by multiple processes, you need to take
care of the following things:

1. Since your mdb file is put on a fileshare, make sure you've grant
sufficient permission in both the fileshare and the NTFS's permission
setting. In my test case I grant both of them everyone full control though
you can adjust them according to your decent scenario.

2. In the OLEDB connectionstring, specify the connection mode as
"Mode=Share Deny None", this means that the connection to the db file
won't
lock it and won't deny any type of access from other client/process(read,
write....). e.g here is the connectionstring generated through the VS ide
connection wizard:(used in my desktop application)

========================
Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet
OLEDB:Database Locking Mode=1;Data
Source="D:\Share_Data\mydb.mdb";Mode=Share Deny None;Jet OLEDB:Engine
Type=5;Provider="Microsoft.Jet.OLEDB.4.0";Jet OLEDB:System database=;Jet
OLEDB:SFP=False;persist security info=False;Extended Properties=;Jet
OLEDB:Compact Without Replica Repair=False;Jet OLEDB:Encrypt
Database=False;Jet OLEDB:Create System Database=False;Jet OLEDB:Don't Copy
Locale on Compact=False;User ID=Admin;Jet OLEDB:Global Bulk Transactions=1
========================

Then, in our ASP.NET application, just use the same connection setting to
access the mdb file(through remote file share). Based on my local test, it
works correctly(I can access it well in both desktop & asp.net application
concurrently).

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 6 '06 #5
You're welcome Jeff,

Glad that you're figured out the problem.

Have a good day!

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Apr 7 '06 #6

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

Similar topics

4
5481
by: John Morgan | last post by:
I have Enterprise Manager on my local machine. For the last twelve months it has been connecting without problem to my online SQL Server database provided by my ISP. Three weeks ago the ISP...
0
1278
by: Rob | last post by:
Is there a way to query Microsoft's index server service from an Access front-end? When you run the index service on a workstation (or a server), you can full-text index a directory/series of...
6
4961
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
1
2552
by: SqlJunkies User | last post by:
Hi I try to call a Webservice via java, the webservice is loacated on a IIS-server(Dot-net). It is a trusted Domain so I do not have to Connect with a Username and Password. It seems to be a...
0
1550
by: Steve DeLong | last post by:
I have a C# Web Service (anonymous access has been disabled) that I would like to connect to with a standard Windows Service, also in C# as part of a scheduled synchronization system. I have...
18
1606
by: Barry Wright | last post by:
Hi All, I have been connecting to this group through Rogers cable my internet service provider. However, Rogers has announced that effective Dec 15th they will no longer providing access to...
35
2515
by: robert d via AccessMonster.com | last post by:
I was asked to provide a proposal. I provided a proposal on my application and the prospective client likes what I have but is wary of it having been developed in Access. I don't understand this...
3
2592
by: Chris | last post by:
Don't know if there is a simple solution for this one or not. When running SQL server on a machine with 2000 loaded and the complete SQL package I don't have any issues. Now I'm trying to login...
10
15915
by: mairhtin o'feannag | last post by:
Hello, I'm having problems connecting to my new v9 db box. The pertinent information is below: DB2_db2inst1 60000/tcp DB2_db2inst1_1 60001/tcp DB2_db2inst1_2 60002/tcp DB2_db2inst1_END...
0
7228
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,...
0
7128
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
7393
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...
0
7502
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...
0
5635
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,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
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...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
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...

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.