Login
Popular Downloads
(Example Reports)
(Example Reports)
(Example Date and Time)
(Example Forms)
(Example Forms)
(Example Forms)
(Templates)
Access Articles
| Get Back End database location |
|
|
|
| Written by Boyd Trimmell aka HiTech Coach | |||
|
When working with a split database, you might need to find the location of the backend. The following code allows you to retreive the location of the back end from the linked table. You simple pass the name of a linked table and it will return the back end's path.
Option Compare Database
Option Explicit Public Function fHTC_GetBEFolder(pTableName As String) As String strFullPath = Mid(DBEngine.Workspaces(0).Databases(0).TableDefs(pTableName).Connect, 11) For I = Len(strFullPath) To 1 Step -1 If Mid(strFullPath, I, 1) = "\" Then fHTC_GetBEFolder = Left(strFullPath, I) Exit For End If Next End Function
Public Function fHTC_GetBEName(pTableName As String) As String Dim strFullPath As String Dim I As Long strFullPath = Mid(DBEngine.Workspaces(0).Databases(0).TableDefs(pTableName).Connect, 11) For I = Len(strFullPath) To 1 Step -1 If Mid(strFullPath, I, 1) = "\" Then fHTC_GetBEName = Mid(strFullPath, I + 1) Exit For End If Next End Function
Public Function fHTC_GetBEFullPath(pTableName As String) As String End Function
|
Sponsored Links
Polls




