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.
Function ExternalTableExists(TableName, DBFullPath)
Dim cn As New ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cn.Open "Provider =Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & DBFullPath & ";User Id=admin;Password=;"
Set rs = cn.OpenSchema( _
adSchemaTables, Array(Empty, Empty, TableName))
ExternalTableExists = Not rs.EOF
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
End Function
Sub ExternalTableExists2(TableName, DBFullPath)
Dim rs As DAO.Recordset
strSQL = "SELECT ForeignName, [Name] FROM MSysObjects " _
& "IN '" & DBFullPath & "' " _
& "WHERE (ForeignName='" & TableName _
& "' Or [Name]='" & TableName & "') " _
& "AND Type=6"
Set rs = CurrentDb.OpenRecordset(strSQL)
Do While Not rs.EOF
Debug.Print rs.Fields(0), rs.Fields(1)
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Sub
SELECT Type, Connect, ForeignName, Name
FROM MSysObjects
IN 'P:\mydatabase.mdb'
WHERE Type = 4;