Delete A Linked Table

J

Joe Fallon

This shows how to do it for linked ODBC tables.
Check out "dbAttachedODBC" in Help to see what to use for linked Access
tables.

Public Sub DeleteODBCTableNames()

Dim dbs As Database, tdf As TableDef, I As Integer
Set dbs = CurrentDb
For I = dbs.TableDefs.Count - 1 To 0 Step -1
Set tdf = dbs.TableDefs(I)
If (tdf.Attributes And dbAttachedODBC) Then
dbs.TableDefs.Delete (tdf.Name)
End If
Next I

dbs.Close
Set dbs = Nothing
End Sub
 
S

Stephen Rockower

OK, how about the other way? ie re-linking certain tables , especially when
opening the database.
What I'm trying to accomplish here is to be able to work on my copy of the
forms/code on my local computer for development with a copy of the data, and
then post it onto the server when I am done, and have the attachments point
correctly.

Thanks

Steve
 
Top