Wednesday, December 26, 2012

MSACC: Dir Paths and ShortCuts

Subject: finding the paths of an MS Access Project
Posted Under: Files, Directories and Path

Borrowed in part but extended from this posting:

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

Option Compare Database
Function g_GetFullName()
   'Returns full path including file to currently opened MDB or ADP
   g_GetFullPath = CurrentProject.FullName
End Function
Function g_GetPath()
   'Returns the path to currently opened MDB or ADP
   g_GetPath = CurrentProject.Path
End Function
Function g_GetFullConnection()
   'Returns the filename of the currently opened MDB or ADP
   g_GetFullConnection = CurrentProject.Connection
End Function
Function g_GetName()
   'Returns the name of of the currently opened MDB or ADP : returns "my app name.accdb"
   g_GetName = CurrentProject.name
  
End Function
' save time run all in one call
Function GetAll()
Debug.Print "con: "; g_GetFullConnection; vbCrLf
Debug.Print "PATH:  "; g_GetPath; vbCrLf
Debug.Print "name:   "; g_GetName; vbCrLf
Debug.Print "Full Path:   "; g_GetFullPath; vbCrLf


End Function



Share: