Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 9th, 2004, 01:02 PM
Registered User
Join Date: Oct 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Issues Connecting to an Access 2000 Database...


I am trying to create a web service that uploads the data contained in a local database for future use. I am using Visual C# .NET and trying to connect to an Access 2000 database.

Using the Server Explorer I can successfully create a connection to the database and then browse the tables and add/remove data using the built in Visual Studio design tools. Help suggests that I drag the connection object into the design window of my web service and code will be generated to connect to the database. This works fine but when I try to run the web service to test the web method, I get the following error:

System.Data.OleDb.OleDbException: The Microsoft Jet database engine cannot open the file 'C:\Documents and Settings\Jonny\My Documents\Visual Studio Projects\ECS\ECS Database.mdb'. It is already opened exclusively by another user, or you need permission to view its data.

The file is not opened by any other user since there is no .ldb Access Record-Locking Information file present in the directory of the database. From this I can assume that it must be a permissions problem yet I am logging in with the Admin account (which has no password).

- I have disabled IIS control of password for the web service.
- The Admin account in the database has full read/write permissions.
- I have .NET v 1.1, Microsoft Data Access Components (MDAC) 2.6 and the newest version of the Jet database engine.

The connection string generated by Visual Studio is as follows:

this.oleDbConnection1.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:\Documents and Settings\Jonny\My Documents\Visual Studio Projects\ECS\ECS Database.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";

I can't see why this connection string would work within the Server Explorer but not when in my code...

Thanks in advance for and help/suggestions.



Old February 11th, 2004, 09:54 AM
Registered User
Join Date: Aug 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts


I think the problem is that you don't have read/write permissions on your database file, e.g. mydatabase.mdb for the ASP.Net and Internet Guest Account users. You need to give the two following users on your Web server read/write permissions:

where MACHINENAME is the name of your Web server

Hope that helps.:)


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 5 Connecting to Access Database robodent BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 4 May 11th, 2006 03:32 PM
Access issues with ASP and a MS Access Database rj_conceptsnrec.com Classic ASP Databases 2 May 19th, 2005 12:44 PM
Connecting to SQL 2000 Database - New at this Tee88 Classic ASP Databases 14 October 2nd, 2004 04:23 AM
Connecting to an Access 2000 database Jonny .NET Web Services 0 November 10th, 2003 03:13 PM
Access XP VBA compatibility issues w/ Access 2000 bourgeois02 Access VBA 1 August 19th, 2003 04:14 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.