?
Solved

Unlock MS Asscess Databases

Posted on 2005-03-30
16
Medium Priority
?
1,625 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

770 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