A function to obtain link table connection information such as 'link specification', current path...
'Get Link Table connection Info
Public Function GetLinkTblConnInfo(Tbl_name As String, param As String) As String
On Error GoTo Exit_GetLinkTblConnInfo
Dim LinkTblConnInfo As Variant
LinkTblConnInfo = SplitStrIntoArray(CurrentDb.TableDefs(Tbl_name).Connect, ";")
Dim param_idx As Integer
Dim LinkTblConnParam As String
param = param & "="
For param_idx = 0 To UBound(LinkTblConnInfo)
LinkTblConnParam = LinkTblConnInfo(param_idx)
If Left(LinkTblConnParam, Len(param)) = param Then
GetLinkTblConnInfo = Right(LinkTblConnParam, Len(LinkTblConnParam) - Len(param))
Exit For
End If
Next param_idx
Exit_GetLinkTblConnInfo:
Exit Function
Err_GetLinkTblConnInfo:
ShowMsgBox (Err.Description)
GetLinkTblConnInfo = ""
Resume Exit_GetLinkTblConnInfo
End Function
沒有留言:
張貼留言