Wrox Programmer Forums
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 May 19th, 2005, 08:25 AM
Registered User
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access issues with ASP and a MS Access Database

Problem Context
I’ve got a problem with an ASP page that queries an Access database. I’m very inexperienced with Access and ASP so my problem might be quite trivial.

I am developing an ASP search page for a library database. The page will only be used infrequently within a small company, so limitations on the number of concurrent users with MS Access shouldn’t be an issue. Additionally, for various reasons beyond my control, I need to stay with MS Access.

As a side note, this page will only be used internally at a small company so security is not of much concern.

My ASP page works fine only when I use it from my computer (I’m hosting it on my machine). When I try to use the page from another computer, just-in-time debugging throws up the following error message:

An exception of type ‘Microsoft JET Database Engine: The Microsoft Jet database engine cannot open the file ‘C:\Inetpub\wwwroot\searchengine\search\library. mdb’. It is already open exclusively by another user, or you need its data.’ was not handled.

While I’m pretty ignorant of what’s going on, I’m not stupid. So, I’ve tried giving read/write share permissions to the directory \search so that the user would have the ability to create the .LDB locking file (http://aspalliance.com/14#permissions). I also tried playing around with the Tools>Security>User and Group Permissions. But not really knowing what I was doing, I just tried different things without success.

Code (line of code at which execution stops at is in red):
strDBPath = Server.MapPath("library.mdb")

Set cnnSearch = Server.CreateObject("ADODB.Connection")
cnnSearch.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"

(some code here... define strSQL)

Set rstSearch = cnnSearch.Execute(strSQL)
Set rstSearch.ActiveConnection = Nothing
Set rstSearch = Nothing
Set cnnSearch = Nothing

What Next?
Any ideas what I need to do in order to get this working? Thanks!

Old May 19th, 2005, 11:38 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts

Well, the problem is, if there is an .ldb file, that is what generates the lock; you are trying to connect to the Access database that is on the same machine as the database, right? What is generating the ldb on the server?

Old May 19th, 2005, 12:44 PM
Registered User
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

I'll try to clarify things a little. I believe that there is a .ldb file creating the lock (based upon reading http://aspalliance.com/14#permissions), but I haven't checked this for myself. The Access database is on the same machine as the webserver. I'm not sure, but I think this answers your follow-up question? Thanks.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database migration MS Access 2003 to MS SQL 2000 ayazhoda SQL Server 2000 3 April 23rd, 2007 11:38 AM
Ms access database in asp-urgent plz netfresher Classic ASP Basics 1 June 30th, 2006 03:35 PM
How to connect to an MS Access database? petercahyadi Java Databases 3 February 22nd, 2005 07:28 PM
Issues Connecting to an Access 2000 Database... Jonny ADO.NET 1 February 11th, 2004 09:54 AM
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.