problem with Locking file

teel73

Registered User.
Local time
Today, 02:46
Joined
Jun 26, 2007
Messages
205
My database is displaying a message that someone is in the database. But there's no one in the database. I had every user that the locking file displayed to log out of the database and shut down there computers. The database is still showing that it's locked. How do I solve that issue?
 
a database has a file called databasename.LDB (in the same folder)

try and delete the .ldb file in windows.

if it wont delete then THERE IS SOMEBODY using the database

--------
now this also sounds like you havent split the database properly - each user should have their own copy of the database - numerous threads here about reasons why
 
thanks for the quick response, but I've tried deleting the ldb I can't because it says someone is in the db. But I've had everyone log out and shut there computers down. I don't know what is going on.
 
Put this code in a module of the database which is locked
Code:
Option Compare Database
Option Explicit

Public Function ShowUserRosterMultipleUsers() As String
'Which computer has locked the database?

    Dim cn                           As Object
    Dim rs                           As Object
    Dim strRetVal                    As String
    Const c_adSchemaProviderSpecific As Integer = -1
    
    Set cn = Application.CurrentProject.Connection
    Set rs = CreateObject("ADODB.Recordset")
    Set rs = cn.OpenSchema(c_adSchemaProviderSpecific, , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
    
    'Represent a list of all users in current database.
    strRetVal = rs.Fields(0).Name & "," & rs.Fields(1).Name & "," & rs.Fields(2).Name & "," & rs.Fields(3).Name
    
    'Remove the NullChar behind every field. Use TrimNull.
    Do While Not rs.EOF
        strRetVal = strRetVal & vbCrLf & Left$(TrimNull(Nz(rs.Fields(0))) & Space(10), Len(rs.Fields(0).Name)) & _
                                   "," & Left$(TrimNull(Nz(rs.Fields(1))) & Space(10), Len(rs.Fields(1).Name)) & _
                                   "," & Left$(TrimNull(Nz(rs.Fields(2))) & Space(10), Len(rs.Fields(2).Name)) & _
                                   "," & Left$(TrimNull(Nz(rs.Fields(3))) & Space(10), Len(rs.Fields(3).Name))
        rs.MoveNext
    Loop
    
    ShowUserRosterMultipleUsers = strRetVal & vbCrLf
    
End Function

Public Function TrimNull(ByVal strItem As String) As String
'Remove the NullChar(\0) of the return string
   Dim intPos As Integer
   intPos = InStr(strItem, vbNullChar)
   If intPos > 0 Then
      TrimNull = VBA.Left$(strItem, intPos - 1)
   Else
      TrimNull = strItem
   End If
End Function
Execute ShowUserRosterMultipleUsers. Beside your own computername, it shows you all other computernames locking this database.

http://support.microsoft.com/kb/287655

Enjoy!
 
Last edited:
Microsoft have a freebie download called LDBView.exe. this also will show who is logged on.
 

Users who are viewing this thread

Back
Top Bottom