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!

Tell me where my MDB or LDB file is???

Status
Not open for further replies.

Alabaster

Programmer
Aug 11, 2001
44
0
0
CA
Is there a way to get the path to the currentDB or current LDB of an access app?

Or better yet, tell me the number of users connected to my mdb.

I've played arround with the workspace, but have had no luck.

Thanks
Peter
 
You can download an LDB viewer from the microsoft website that can tell you how many people are using your mdb and who is using it at any time

Search their site for this ... I,ve used it and its pretty helpful when trying to get people to stop using the database while you carry out some maintenance

Cheers

Bow
 
Here's what I use to get the user/machine list:
As I review the code I just pasted in, several of the functions are from Getz's Access Developers Guide (best book on access I've ever seen) so I don't feel right posting them here but heres what they do:

dhRInstr - returns the rightmost occurrance of the character searched for.

dhTrimNull - returns the string passed up to but not including any trailing null chars.

Luther

Option Compare Database
Option Explicit
Private Type UserInfo
Computer As String * 32
SecName As String * 32
End Type


Public Function GetUsers() As String
Dim DataFile As Long
Dim sFile As String
Dim uUserInfo As UserInfo
Dim UserInfos As New Collection
Dim sTemp As String
Dim lIndex As Long

On Error GoTo ERROR_

sFile = CurrentDb.Name
sFile = Left(sFile, dhRInstr(sFile, "."))
sFile = sFile & "ldb"
DataFile = FreeFile
Open sFile For Random As DataFile Len = Len(uUserInfo)
lIndex = 1

Do While lIndex <= (LOF(DataFile) / Len(uUserInfo))
Get DataFile, lIndex, uUserInfo
uUserInfo.SecName = dhTrimNull(uUserInfo.SecName)
uUserInfo.Computer = dhTrimNull(uUserInfo.Computer)
sTemp = &quot;User: &quot; & Trim(uUserInfo.SecName) & _
&quot; on Machine: &quot; & Trim(uUserInfo.Computer) & vbCrLf
lIndex = lIndex + 1
Loop

GetUsers = sTemp

Exit_Function:
Close DataFile
Exit Function

ERROR_:
Select Case err.Number
Case Else
MsgBox &quot;Error &quot; & err.Number & vbCrLf & _
err.Description & vbCrLf
End Select
Resume Exit_Function
End Function

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top