Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Unlock MS Asscess Databases

Posted on 2005-03-30
16
Medium Priority
?
1,633 Views
Last Modified: 2012-06-27
My site uses an Access database thorugh a DSN Connection. Every once in a while, I get a page that doesn't completly work, and the code to close the database sticks the databse open, and I get an ldb file.

Since every page in my site uses the database, If I don't close the database, I eventually lock the site up.

I've tried deleting or renaming the ldb fle from ftp, but I can't. Is there a script (I use vbscript) of some sort that can unlock the database?

Thanks

M
0
Comment
Question by:MoMarvi
16 Comments
 
LVL 6

Accepted Solution

by:
masirof earned 2000 total points
ID: 13665088
Stop web site, and then delete it.
Be sure to close all your recordset and connections to database after you have opened them.
0
 
LVL 11

Expert Comment

by:Jokra_the_Barbarian
ID: 13665111
While using an Access database for web stuff is not unheard of, it is definitely not the best practice. I would recommend migrating to an MSDE or SQL Server 2000 platform if possible. If not, then you might want to try:
1. using a DSNless connection vs. DSN.
2. take a look at how your recordsets are using the tables, recordlocking, etc..
3. might be a network issue if the database resides on a network share.
4. the database might become extremely bloated, try running a nightly batch script to compact and repair the database.

note: Access always creates a lockfile when the database is opened.
0
 
LVL 23

Expert Comment

by:apresto
ID: 13665136
I agree with both, but masirof has a point

If you dont close the database connection in every page then every time you navigate to another one you are opening another database connection, MSaccess can only handle about 25-30 connections at once, and that is on a very very Good day!!!
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:kiddanger
ID: 13666269
It looks like all possibilities have been covered but showing the code eliminates the guesswork.
0
 
LVL 2

Author Comment

by:MoMarvi
ID: 13790188
Sorry this has taken so long

masirof
Sometimes, stopping the website doesn't release the lbd file.

Jokra_the_Barbarian
I would love to use something more robust than Access, but there are several reasons to use it for now.
Why would a DSNLess connect work better? I thoguht a DSN was more efficient.
I know my problem has to be with not closing all my connections. My code was pretty sloppy when I started. I am tracking down the leaks, but it takes a while with several hundred pages.
It's not a network issue, since the db is on the same folder as the rest of the site
The database may be becoming bloated. I'll have to look into compacting on the server.

apresto
I think as I said to Jokra_the Barbarian that I have a leak or ten by not closing connections.

kiddanger
Since I'm not sure of where the rest of my leaks are, posting the code is highly improbable, unless you have a Bambleweenie 2000 Matrix Generator, and a really hot cup of tea (Sorry, I'm waiting for the Hitchhikers Guide to the Galaxy Movie to come out)

0
 
LVL 14

Expert Comment

by:kiddanger
ID: 13803130
MoMarvi...

Not showing relevant code is not going to get you much help.
A DSN-less connection is more efficient because it doesn't have to pass the connection off, it just connects directly.  Doing one thing is more efficient than than doing two things.
If you have leaks, then close connection and destorys objects.

If you have an open connection, and it's called conn, then:

conn.Close

Same for recordsets:

rs.Close

Then destroy the objects:

set conn = nothing
set rs = nothing

In VBScript, an obect is defined by 'set'.  So, if you created an object, destroy it.  Simple.  Just match the sets.
0
 
LVL 2

Author Comment

by:MoMarvi
ID: 13803364
Kid

I know about the leaks, and I am hunting them down. I know how to close and destry connections, I just got a bit sloppy in my initial coding.

As I said before, I have 150 separate pages that call the database, so picking the code to show is a bit daunting. My question had to do with how to unlock a locked database, until I track down the leaky code.

Any Ideas?

Mo
0
 
LVL 14

Expert Comment

by:kiddanger
ID: 13803554
You shouldn't have a locked database.  You should also consider using includes and put common routines in one file, rather than putting the same routine in multiple files.  Also, if you're using ODBC, I'd recommend against it.

See if this will help for now:
http://www.enterhost.com/supportcenter/faq/search_answer.cfm?fqid=100113
0
 
LVL 22

Expert Comment

by:WMIF
ID: 14876557
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.  I will make a recommendation to the moderators on its resolution in a week or two.  I appreciate any comments that would help me to make a recommendation.

Unless it is clear to me that the question has been answered I will recommend delete without refund of points.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade.  It is assumed that any participant not responding to this request is no longer interested in its final disposition.

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help.jsp#hs5

WMIF
EE Cleanup Volunteer
0
 
LVL 14

Expert Comment

by:kiddanger
ID: 14877655
Never got a reply.
0
 
LVL 2

Author Comment

by:MoMarvi
ID: 14881003
It's taken a while, but I've tracked down all my leaks, and resolved the issue.

masiroff was correct. It just took along time to track down all the open connections.

My original question was how to unlock a locked acces database. Even stopping IIS will not unlock a locked access database. A full reboot (Not fun to ask for on a shared server) seems to be the only way to unlock the database.

0
 
LVL 14

Expert Comment

by:kiddanger
ID: 14884076
IIS has nothing to do with Access.  Access is not an application server like MS SQL.  A full reboot is not required.  You have another option.

http://www.hostmysite.com/support/programming/locked-db/
0
 
LVL 2

Author Comment

by:MoMarvi
ID: 14890927
Interesting,

HostMySite is my host, and they never suggested this during our discussions.

Oh-well.
0
 
LVL 14

Expert Comment

by:kiddanger
ID: 14891181
They may not know it is an option.  I would think they gave you a truthful answer based on their knowledge in this area.
0
 
LVL 2

Author Comment

by:MoMarvi
ID: 14891384
I have dealt with several hosts in the past couple of years, and HMS has been by far the best. HSB has been orders of magnitude better than any host I have used, including one that was a branded site of a huge US PC manufacturer.

I'll let this one by.
0
 
LVL 14

Expert Comment

by:kiddanger
ID: 14893988
I'm not familiar with them but I'm sure there are plenty of good hosts out there.  I have been happy with discountasp.net, actwd.net and exabytes.com.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question