Solved

Access - LDB lock file

Posted on 2016-10-07
4
35 Views
Last Modified: 2016-10-07
I have an app that opens a OLEDB connection to access database.  I close the connection and call  Dispose.  However, the LDB stills exist and does not go away until I close the app.   Is this normal?
0
Comment
Question by:HLRosenberger
  • 2
  • 2
4 Comments
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
It can be.  It depends on if the user/process has delete rights on the file and directory.

Normally the .LDB is deleted when the last user exits the DB.   But it is left if security prevents deleting it, or the DB has been flagged corrupt (so the the user can be identified).

If your able to still use the DB after it's left, then there is not really an issue.

Deleting of the .LDB was added long ago to speed up logins on Novell servers, but it's not actually required.

Jim.
0
 
LVL 1

Author Comment

by:HLRosenberger
Comment Utility
yes, I can still use the database afterwards, even with the LDB present..    And I can manually delete the file.
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
Comment Utility
<<yes, I can still use the database afterwards, even with the LDB present..    And I can manually delete the file.>>

 So it's probably directory security on the file for the process/user that is using the DB.

 and there is no real harm in it being left behind.  It's nice though in that you have an indication that no one is in the DB and it cleans out "phantom users".

  I'll explain the last a bit.  When you login to a DB, an entry is created in the LDB file, which is an array of 255 elements of 64 bytes each; 32 bytes for the machine name and 32 bytes for the user name.

  For the user name, unless you use workgroup security, all the users will read as "admin".

  Once that entry is made, a corresponding "user lock" is created.  This is actually what tells you a user is active or not.

 Many LDB view utilities do not check for this lock, but simply look in the LDB file iteself.   If they do this, then you might see old "phantom" users who are not actually in the DB.

 However if those utilities use the JET ShowUserRoster function, or the ADO method, the locks are looked at and users will be reported accurately.

Jim.
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
Comment Utility
ok.  thanks!
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now