formerTexan
Programmer
Hi,
Set cat = New ADOX.Catalog
cat.ActiveConnection = CurrentProject.Connection
If I use the ADOX catalog method to raise the Tables collection (as outlined in the code above), a problem occurs if a table has just been deleted. A reference to the deleted table shows up in the collection. But an error is then raised when an attempt is made to open a recordset based on the now nonexistent table.
So is there anyway to update the Tables collection without doing a Compact/Repair or closing and reopening the application?
Using Cat.Tables.Refresh occurred to me, but it doesn’t fly.
I’m sure there is a more lucid way of describing what is actually going on, but hopefully I’ve relayed the gist of the problem.
Thanks for any suggestions,
Cheers,
Bill
Set cat = New ADOX.Catalog
cat.ActiveConnection = CurrentProject.Connection
Code:
For Each tbl In cat.Tables
If tbl.Type = "TABLE" Or tbl.Type = "LINK" Then ' No views, queries or system tables.
rs.Open (tbl.Name), cnn, adOpenForwardOnly, adLockReadOnly
If I use the ADOX catalog method to raise the Tables collection (as outlined in the code above), a problem occurs if a table has just been deleted. A reference to the deleted table shows up in the collection. But an error is then raised when an attempt is made to open a recordset based on the now nonexistent table.
So is there anyway to update the Tables collection without doing a Compact/Repair or closing and reopening the application?
Using Cat.Tables.Refresh occurred to me, but it doesn’t fly.
I’m sure there is a more lucid way of describing what is actually going on, but hopefully I’ve relayed the gist of the problem.
Thanks for any suggestions,
Cheers,
Bill