Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / April 2006

Tip: Looking for answers? Try searching our database.

Help connecting to Access DB from web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff Richardson - 01 Apr 2006 02:13 GMT
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
Mary Chipman [MSFT] - 02 Apr 2006 16:31 GMT
Is there a reason why you can't use SQL Express? Jet is totally
unsuited as the data store for an ASP.NET application. If you persist,
you are always going to have headaches. One of the reasons is locking,
as you have discovered. It's not hard to Import Jet data to Express,
and Express is free, so there is no compelling reason not to use it.

--Mary

>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
[quoted text clipped - 29 lines]
>Thanks in advance,
>Jeff Richardson
Jeff Richardson - 03 Apr 2006 17:39 GMT
Hi Mary,

Thank you for your reply.

The compelling reason is that the desktop application, mentioned below, is a
commercial application that uses the Access db as its native file format.  I
can not abandon the commercial application because it provides functionality
that I have not been able to duplicate myself.

Are you aware of a work-around form my file locking problems while running
under IIS?

Thanks in advance,
Jeff.

> Is there a reason why you can't use SQL Express? Jet is totally
> unsuited as the data store for an ASP.NET application. If you persist,
[quoted text clipped - 38 lines]
>>Thanks in advance,
>>Jeff Richardson
Mary Chipman [MSFT] - 05 Apr 2006 18:23 GMT
Gotcha -- Jet can be a lot more flexible as long as you don't care
about security and work around its inherent fragility. It looks like
Paul has given you the answer to your question. Just out of curiosity,
what is the functionality that you can't duplicate?

--Mary

>Hi Mary,
>
[quoted text clipped - 53 lines]
>>>Thanks in advance,
>>>Jeff Richardson
Paul Clement - 03 Apr 2006 17:52 GMT
¤ 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?

What the error is telling you is that there is a permissions problem with the remote resource. In
order to work with an Access database each user (or the ASPNET or NetworkService user if the app is
not configured for impersonation) must have full permissions to the resource where the database is
located. This is required to create, update and delete (after the database has been closed) the
corresponding .LDB file.

Paul
~~~~
Microsoft MVP (Visual Basic)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.