Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Public Function basCkTblAttd(MyTbl As String) As Boolean
'Michael Red 10/14/02 Check if Table is LINKED
'Tek-Tips thread705-379978
Dim rst As ADODB.Recordset
Dim Cmd As ADODB.Command
Dim Cnn As ADODB.Connection
Dim strSql As String
strSql = "SELECT MSysObjects.Connect, MSysObjects.ForeignName, MSysObjects.Name "
strSql = strSql & "FROM MSysObjects "
strSql = strSql & "WHERE ((Not (MSysObjects.Connect) Is Null) And "
strSql = strSql & "((MSysObjects.Name) = " & Chr(34) & MyTbl & Chr(34) & "))"
Set Cnn = CurrentProject.Connection 'Normally on initial open of Application
Set Cmd = New ADODB.Command
With Cmd
Set .ActiveConnection = Cnn
.CommandType = adCmdText
.CommandText = strSql
End With
Set rst = New ADODB.Recordset
rst.Open Cmd.Execute
If (Not (rst.BOF = True And rst.EOF = True)) Then
'NoRecords ==> Not a linked Table in this db
basCkTblAttd = True
' Do whatever you want here .......
End If
Set rs = Nothing
Set Cmd = Nothing
Set adoCN = Nothing
End Function