top
logo

Login




Access Articles
Get Back End database location PDF Print E-mail
User Rating: / 0
PoorBest 
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 
'
' 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   
 
 

Sponsored Links

Polls

Using Microsoft Access
 

bottom
top

Latest News

Popular


bottom

Powered by Joomla!. Designed by: Free Joomla 1.5 Theme, linux hosting. Valid XHTML and CSS.