Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to delete an .ldb file. 6

Status
Not open for further replies.

FiftyFive

Programmer
Dec 20, 2000
3
0
0
US
I have an Access application that is supposed to log in a user periodically from WinAt, run a process and quit. The process is not completing however and the application thinks that the user is still logged on. As far as I can tell the .ldb file keeps track of who is loged on. Since it thinks someone is logged on the application cannot be renamed, opened exclusively or compacted. Is there a way to kill the .ldb file or logoff the user that the application thinks is still logged on?
 
If no one is really logged in, just delete it like any (other) file.

MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
The .ldb file cannot be deleted, thats why the .mdb file cannot be renamed etc.
 
Then, someone is REALLY logged on to the database.

Stop ALL access to the database.

Close ALL instances of Ms. Access which even MAY have a connection to the database.

Delete the .ldb file. It WILL work, if no one is really connected!

Do your 'other' stuff (renanme etc.)

Another way to "see" if someone is 'logged on' is to attempt to copy the .MDB file (to anywhere). If it is 'not' in use, you can copy it. If you can't copy it, then someone has it 'open'.

If you get here and still can't do the operation, - then RE-Boot the system. And - start over.

MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
I have the same problem with my Access 97 DB. The locking file will not close and it cannot be deleted. If I right click on the "ldb" file and open it with notepad, it will show that I have it open even though I don't have it open. It is possible to copy the mdb file to another location but the ldb file remains and you cannot delete (or move) it.

If anyone can tell us what causes this and how to fix it, it would be greatly appreciated.

Bill Sheetz
 
Have you tried rebooting the machine that the .LDB file is on? This usually frees up any ghost links...

Terry M. Hoey
th3856@txmail.sbc.com

Ever notice that by the time that you realize that you ran a truncate script on the wrong instance, it is too late to stop it?
 
MichaelRed is right, if no one has the database open, you will be able to delete the .ldb file.

Use the server manager to delete all resources that are open for the database. You will then be able to copy the database, delete the .ldb, or do whatever you want with the database.
Mike Rohde
rohdem@marshallengines.com
 
Thank you all for your suggestions. I rebooted the server and the .ldb file disappeared.
 
I'm having a similar problem. I have several ASP pages that connect to my database. I've found that if, for whatever reason, my database crashes, the .ldb file will still show me as being logged on, even though I'm not. I've tried to delete the .ldb file, and I couldn't. I've gone into the server resources, and deleted all instances of someone using the database, and the .ldb still wouldn't let me delete it. The only thing I've found that works is rebooting the machine. But since this file is on a server that is being used by up to 100 people at one time, rebooting the server isn't always the best thing to do. To further complicate issues, if after the database crashed, and there remains an entry in the .ldb file, and someone tries to access one of the ASP pages, it causes a reaction that eventually shuts down all web serving for the entire server. This, as you can see, is extremely bad, and needs to be fixed.

At first glance, I think it'd be nice to have some way of being able to clear an .ldb file without rebooting (just deleting it is NOT an option, it doesn't work). Are there any programs out there that will let you clear the file? I've found some .ldb file programs types on Microsoft's web page, but I haven't found one that allows me to clear an .ldb file.

Any other possible suggestions on how to resolve this problem?

Thanks,
Dana
 
I have an .ldb file that I can't delete. When I open the file with Notepad it says that I am the user that has the database open, but I don't. I've rebooted my machine twice and the ldb file is still open and no one else has the database open. What do I do now? I can't reboot the server because I can't get into the server room. Jessica Morgan
Fire Fighter Sales & Service Co.
Pittsburgh, PA
 
Ms. A's ".LDB" file is a bit (Lot?) strange. It's purpose is to identify record (block) locks by user, not actually to show current log in entries to the db. Since MS didn't intend the file to be used as a log in list, they (strangely -but characteristically) chose to not (always) remove log in entries when a user disconnects. 'They' (the Ms folks) simply (but not obviously) mark the entry (as unused), and (usually) assign the next user to the vacated slot. Of course, this marking and reassigning can only occur when the users connect (and more importantly) disconnect from the db in an "orderly" manner. This (obviously?) doesn't occur on CRASHES, so 0 or more User entries will remain in the LDB file wheen the db is closed via a faullt.

Aparently, someone within Ms realized this and they added some process to simply delete the LDB file under certain conditions (e.g. when the db is closed (in the orderly manner, or the USER is the first or only? user). Some other considerations DO apply, but the exact details are not generally available.

More confusion arises when a database is split in any of several ways, as MS A. Creates an "LDB" file for every mdb file which is accessed - even if there is NO data (Records) to lock, so some users may be confused, looking at a ".LDB" file for the FE, while thinking of a BE db which is not open at all. With the notable exception of MDB's being accessed on read only media, the corresponding LDB is created in the same "folder" as the corresponding MDB, so if you have the traditional "Split" db in Ms. A., as soon as you 'touch' the FE, you will create an LDB on your local system and either create another LDB where the BE is located (if you are the FIRST user) or add an entry to the existing LDB for the BE. So, you need to be quite careful of which LDB file you are looking for, and also make sure that all connections to the db are closed, rembering that there are NUMEROUS possabilities in this latter realm.

One approach -which has been discussed in these forums- is to generate a "bootoff" process which uses the LDB file and a simple structure to generate a logoff process (generally implemented to be able to accomplish maintenance). When ever the db gets locked up (or just becomes inactive) have the "bootoff" procedure disconnect all users.

I have NEVER seen the situation where a ".LDB" file cannot be deleted if there are no 'users' connected. This behaviour is not dependent on ANY Ms. A. user characteristic or activity, but is a general property of windows file management, which (very seperatly) tracks 'connections' to each file. If there are NO connections, and you have appropiate permissions, you MAY delete any file, specifically including the ".LDB"s. MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
I too have a database that is locked by a user that is not logged on. She is on a laptop and the laptop is disconnected from the network cable but the ldbview.exe says she is logged into the backend database only. She can login and out of the frontend but it still says she is logged into the backend database. This has happened once in the past. What we end up finding is that we have a corrupt record. I have to find any records that she has entered on the day that the lock occurred and delete them. This removes the ldb problem. This is the second time that this has happened in this database. I don't know what is causing the problem but this is the first time I have ever seen it happen in Access that you couldn't delete a ldb. If I hadn't seen this myself, I would agree with Michael that it was impossible.
Trisha
padinka@yahoo.com
 
Yep I am having this problem too. This database is on a home computer and I cannot figure out for the life of me who would have it open. As a matter of fact I have had this happen numerous times on numerous machines. Usually a reboot does the trick, but I can't even get that to work. I uninstalled my IIS, so I am not even serving...arggh.


Sera
I often believe that...
My computer is possessed!
 
Citrix can also cause this problem. Depending on how the Citrix session is closed out, it will also indicate that it is logged onto the Db adn won't release the ldb file.
RGB
 
You should not need to delete the LDB file, that should happend automatically when there are no users left.
Are you sure that the program closes the database properly? IE it closes all the recordsets it has open and then closes the database.
 
I am pretty sure. This database is part of a web content management package called aspnuke. It is freely downloadable and really pretty neat. The machine the database is on has no office programs installed. The database is being accessed through an OLEDB connection. So it has not been opened and then closed by me. I am no longer serving to the internet as I have deleted my IIS. No one really knew it existed anyway because it was just loaded for testing purposes. So I don't really believe that someone is logged onto the website. I have completely killed my internet connection just to make sure though and it is still open. I have restarted my machine numerous times and I am logged on as administrator and I still am unable to delete it. I cannot figure out why it is open.
Maybe I could write a script to close it? I have no idea what to do...usually a restart fixes this....


Sera
I often believe that...
My computer is possessed!
 
I have sometimes found that an Access database that needs repairing does not delete it's LDB file when the last user leaves.
Try repairing the database.
 
Do you know if it is possible to repair through code? I don't have office installed on the machine this database is on, as I said before it is being accessed through and OLEDB connection. It is possible for me to install office, but I would like to know if it can be done through code first. Thanks, that does sound like a good option.

Sera
I often believe that...
My computer is possessed!
 
One brief note.....if the database is stored on a server, in a shared folder, instead of rebooting the server, you can just unshare the folder, delete the .ldb file, then share the folder again. The unsharing will break the ghost links, and by not rebooting the server, you have not limited anyone else using that server....

****************************
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III
MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: wildmage@tampabay.rr.com
 
It is possible to repair a database without MS Access. Use the JETCOMP utility:



Note it says you are required to have one of the following installed:
Microsoft Office 97
Microsoft Office 2000
Microsoft Access 97
Microsoft Access 2000
Microsoft Visual Basic 5.0
Microsoft Visual Basic 6.0
A Microsoft Office Developer Edition 97 run-time application that includes the run-time version of Microsoft Access 97
A Microsoft Office Developer 2000 run-time application that includes the run-time version of Microsoft Access 2000
A Microsoft Visual Basic 5.0 run-time application that includes Microsoft Jet database engine 3.5
A Microsoft Visual Basic 6.0 run-time application that includes Microsoft Jet database engine 3.5 or 4.0


But maybe it will work without any of them installed.

--
Find common answers using Google Groups:

Corrupt MDBs FAQ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top