Code Snippet "VBA Access"
Pfad und Dateinamen einer Access-DB in Bestandteile zerlegen
Dim pathAndFilename As String
Dim drive As String
Dim path As String
Dim filename As String
pathAndFilename = Application.CurrentDb.Name
Debug.Print "DB: " & pathAndFilename
pos = InStr(pathAndFilename, ":")
drive = Left(pathAndFilename, pos)
pos = InStrRev(pathAndFilename, "\")
path = Left(pathAndFilename, pos)
filename = Mid(pathAndFilename, pos + 1)
Debug.Print "Drive: " & drive
Debug.Print "Path: " & path
Debug.Print "Filename: " & filename