The following function works fine for finding tables in an MS Access database through the standard new connection and recordset **but it does not find queries or linked tables.
Function CHKtablename(TABLECHK As String) As Boolean
Dim conn As New Connection
Dim rs As New Recordset
Dim strconn As String
Dim qry As String
Dim chk As Boolean
strconn = "provider=Microsoft.Ace.Oledb.12.0;" & " Data source= Source path" & "user id=admin;password="
conn.Open(strconn)
Set rs = conn.Openschema(adschematables)
While Not rs.EOF
If rs.Fields("Table_Name") = TABLECHK Then
CHKtablename = True
End If
rs.Movenext
Wend
End Function
How can I change this to find them?
I appreciate your time and help.
rsopen? Where does it do that?function. Yet you say it works fine. Use QueryDefs to verify if query exists.