I have code that deletes all the data from all the non-system tables in the database:
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Now that my process has grown, I have tables which are linked to another database.
When I run the above code, I do not want to delete the data from the linked tables (only the data from the tables which reside in my Database). My question is:
Is there anyway to distinguish a "linked" table from the rest of the tables in the database, so that I can programmatically omit the "linked" tables from this data delete process?
Thanks,
Gary
--------------------------------------------------------------------------
Code:
Dim dbCurr As DAO.Database
Dim intLoop As Integer
Set dbCurr = CurrentDb()
For intLoop = (dbCurr.TableDefs.Count - 1) To 0 Step -1
If Not Left$(dbCurr.TableDefs(intLoop).Name, 4) = "Msys" Then
DoCmd.RunSQL "DELETE * FROM " & dbCurr.TableDefs(intLoop).Name & ";"
End If
Next intLoop
Set dbCurr = Nothing
--------------------------------------------------------------------------
Now that my process has grown, I have tables which are linked to another database.
When I run the above code, I do not want to delete the data from the linked tables (only the data from the tables which reside in my Database). My question is:
Is there anyway to distinguish a "linked" table from the rest of the tables in the database, so that I can programmatically omit the "linked" tables from this data delete process?
Thanks,
Gary