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?
 
Thanks I will try it when I get home and let you know how it turned out.



Sera
I often believe that...
My computer is possessed!
 
The problem it would seem is that when the Access database is closed and all users have exited the LDB file is not deleted because Access is still active in memory taking up space and resources. If you use ctrl-alt-del and check the task manager you will find an active Access session.

In addition to this you will find that if you open your database again and then log out, you will find 2 active Access sessions in memory. You can do this so many times that all system resources are used up and usually your machine will lock up or crash. I have had 13 active sessions at one time when testing software requiring multiple Access sessions on one machine - all linked to one LDB file.

In this case the only way to delete the lock file is to open the task manager and stop all Access sessions. You will then be able to delete the LDB file.

There can be many reasons for this from a corrupted MDA or MDW file to the last user not having delete file permissions on the hard disk so the LDB file can not be deleted by Access.

If anyone requires more information then post your questions please. I hope that this will help what seems to be a common problem!

Tony
 
Tony,
While I agree that this is a very good answer and obviously a very buggy problem. I think that the problem extends further. I have completely shut my computer down...and restarted numerous times, and I still have yet to be able to delete the .ldb file. I have worked with Access for over 3 years now and I have seen the problem that you are all describing. The .ldb doesn't close for one reason or another, but the problem is always either fixed within the task manager, as you stated, or with a reboot. This particular time, that is not getting the job done. I haven't gotten the office package installed on my computer yet, so I haven't tried to repair...this is a home project and does not have a high priority. I will post when I try a repair and inform people of my success or failure.



Sera
I often believe that...
My computer is possessed!
 
You could try the following. This sequence will remove files with an illegal character embedded in the file name which normal methods won't recognise

Tony

Open a Command Prompt window and leave it open.
Close all open programs.
Click Start, Run and enter TASKMGR.EXE
Go to the Processes tab and End Process on Explorer.exe Leave Task Manager open.
Go back to the Command Prompt window and change to the directory where the undeletable file is located.
At the command prompt type DEL <filename> where <filename> is the file you wish to delete.
Go back to Task Manager, click File, New Task and enter EXPLORER.EXE to restart the GUI shell.
Close Task Manager.

 
On a network it is necessary for users to have READ, WRITE and DELETE access to the folder in which the database is located in order that the ldb file can be deleted when the last user closes the database.

It is possible to see who is logged in to an Access database using a utility provided on the Microsoft support site (KB198755) at:


Run this in the immediate window for a list of users still (allegedly) logged in.

John R
 
I have been following this thread with some interest as I have a similar problem with a rogue ldb file. Each night I schedule a compact on two access databases thru VB code (using JRO). One of the compaction jobs works fine, the other always fails with the message:

-2147467259 You attempted to open a database that is already opened exclusively by user 'AlanB' on machine 'PROD-SQL'. Try again when the database is available.

Rebooting is not an option as the machine (PROD-SQL) is our PDC and main SQL Server machine....

I have checked in task manager and no instances of access are reported and I have checked in Computer Management and nothing is accessing the ldb, yet I still cannot delete it!!

What I need is to get rid of this ldb file!!!

Regards,

Alan
 
Alan

Did you try the utility I highlighted above? What access rights does the user have to the directory in which the database is stored?

John R
 
I have run into this in the past especially regarding FE/BE or ODBC apps. These are on a network or running on a stand-alone with NT or XP.

I found this will usually allow you to correct the issue.

1>Copy the affected .mdb to another local. Repair and compact it. Copy it back to the original location, overwrite the original .mdb.

2> If on a stand-alone, open the app and then close it. Reboot.

3> If on a server, ensure every session is closed prior to the overwrite, overwrite the .mdb, have on user with admin rites open the app and then close it. Once all server processes associated with the app have finished, the .ldb should go away or be deletable.

Does not always work, but usually does.

Luck!



Rhonin
&quot;too many questions, too little time...&quot;
 
I have a situation similar to what everyone has discussed here. When my users log out of the database, there seems to be some error in closing, and the database is creating copies of itself and naming them db1, db2, and so forth. They have to be manually deleted from the shared directory. I need to figure out how to stop this from happening, or MIS is going to get really peeved with me for all the space my db keeps eating up on the share drive. JR2913 mentioned something about users needing Read, Write and Delete access to the shared directory... could this be causing my problem? Is there a better way to handle the users' exit from the system than access.quit?
 
I have seen this issue more than once, and although you do not see an active connection to the db there is probably a file open. If you go to computer management on the server, then click on "shared folders" then expand "open files" you will probably find a stray file related to your database. Close this file and then you will be able to delete the ldb. I have seen these files survive a reboot.
 
There is a way to delete a ldb-file
thread181-1068969
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top