Microsoft Most Valued Professional MVP - Access Expert

mvp.png

  Boyd Trimmell, aka HiTech Coach
  Microsoft MVP - Access Expert


What is a Microsoft  Most Valuable Professional (MVP)?
Microsoft  awards the Most Valuable Professional (MVP) in recognition of significant contributions made to technical communities by sharing high quality, real world expertise. Microsoft Most Valuable Professionals (MVPs) are a worldwide network of exceptional technical community leaders.

"If technology doesn't work for people, then it doesn't work."
- Kim Vicente

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.

{codecitation class="engine parameters" width="" }

Option Compare Database

Option Explicit   

Public Function fHTC_GetBEFolder(pTableName As String) As String
'
' usage example: fHTC_GetBEFolder("Suppliers")
'
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_GetBEFolder = Left(strFullPath, I)

          Exit For

     End If


Next

End Function



Public Function fHTC_GetBEName(pTableName As String) As String
'
' usage example: fHTC_GetBEName("Suppliers")
'

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
'
' usage example: fHTC_GetBEFullPath("Suppliers")
'
fHTC_GetBEFullPath = Mid(DBEngine.Workspaces(0).Databases(0).TableDefs(pTableName).Connect, 11)

End Function

{/codecitation}