Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Zugriff auf Access-DB

Empfohlene Antworten

Veröffentlicht

Hallo,

Mich würde mal interessieren, ob man irgendwie auslesen kann welche Benutzer alles in einer Datenbank drin waren...

Kann man da irgendwie ein Protokoll generieren...

Wäre nicht schlecht wenn so was möglich wäre...

Danke

Gruss

Zoran

Soviel ich weiss nicht, du kannst dir lediglich in der *.ldb angucken, wer aktuell grade zugriff auf die Datenbank hat und anhand der letzen Änderung wer diese geändert hat.

Naja vielleicht hat noch jemand Tipps ob man das machen kann

mit der Protokollierung der Benutzer die Zugriff haben auf die Datenbank

Access allein kann das auf keinen Fall, du könntest dir aber eine VBA Anwendung für die Datenbank schreiben, die sich beim Aufruf den Benutzernamen aus den Umgebungsvariablen holt und in eine TXT Datei schreibt und dazu vielleicht noch ein Datum hinzufügt.

Hier den Quellcode habe ich gefunden

dabei zeigt alle User an die die DB geöffnet haben

Bloß hat er irgendwie an manchen Stellen ein Problem beim Kompilieren unter Access97 bei 2000 gehts....

Er bringt irgend so nen Fehler Objektbibliothek nicht gefunden

Private Sub UpdateBtn_Click()

Me.LoggedOn.RowSource = WhosOn()

End Sub

'-------------------------------------------------------------------------------------

' Subject : WhosOn()

' Purpose : Will read *.LDB file and read who's currently

' logged on and their station name.

'

' The LDB file has a 64 byte record.

'

' The station name starts at byte 1 and is null

' terminated.

'

' Log-in names start at the 33rd byte and are

' also null terminated.

'

' I had to change the way the file was accessed

' because the Input() function did not return

' nulls, so there was no way to see where the

' names ended.

'-------------------------------------------------------------------------------------

Private Function WhosOn() As String

On Error GoTo Err_WhosOn

Dim iLDBFile As Integer, iStart As Integer

Dim iLOF As Integer, I As Integer

Dim sPath As String, X As String

Dim sLogStr As String, sLogins As String

Dim sMach As String, sUser As String

Dim rUser As UserRec ' Defined in General

Dim dbCurrent As Database

' Get Path of current database. Should substitute this code

' for an attached table path in a multi-user environment.

Set dbCurrent = DBEngine.Workspaces(0).Databases(0)

sPath = dbCurrent.Name

dbCurrent.Close

' Iterate thru dbCurrent.LDB file for login names.

sPath = Left(sPath, InStr(1, sPath, ".")) + "LDB"

' Test for valid file, else Error

X = Dir(sPath)

iStart = 1

iLDBFile = FreeFile

Open sPath For Binary Access Read Shared As iLDBFile

iLOF = LOF(iLDBFile)

Do While Not EOF(iLDBFile)

Get iLDBFile, , rUser

With rUser

I = 1

sMach = ""

While .bMach(I) <> 0

sMach = sMach & Chr(.bMach(I))

I = I + 1

Wend

I = 1

sUser = ""

While .bUser(I) <> 0

sUser = sUser & Chr(.bUser(I))

I = I + 1

Wend

End With

sLogStr = sMach & " -- " & sUser

If InStr(sLogins, sLogStr) = 0 Then

sLogins = sLogins & sLogStr & ";"

End If

iStart = iStart + 64 'increment to next record offset

Loop

Close iLDBFile

WhosOn = sLogins

Exit_WhosOn:

Exit Function

Err_WhosOn:

If Err = 68 Then

MsgBox "Couldn't populate the list", 48, "No LDB File"

Else

MsgBox "Error: " & Err.Number & vbCrLf & Err.Description

Close iLDBFile

End If

Resume Exit_WhosOn

End Function

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.