Code to delete/unlink Linked tables

From: LisaB (lbagley(ReTHis)_at_mayatech.com)
Date: 09/09/04


Date: Thu, 9 Sep 2004 14:55:54 -0400

Is the code I can write to disconnect/unlink linked tables

1. I have an Access 2000 database that has over 65 linked SQL tables.
2. I need to be able to switch between the Live data tables and Test data
tables
3. Using the Linked table manager gives me an error because some of the
links are to Views
4. Currently, I have to delete each table by hand (which is a really big
pain in the ...)
5. I have the code to rename the tables since they come in with the dbo_
prefix. Maybe there is a way to modify this code to loop through and delete
the table (but only if it is a linked table) I also have local tables that
should not be deleted
------------------------------------------
Public Function RenameTablesdbo()

Dim db As DAO.Database
Dim tbl As DAO.TableDef

 Set db = CurrentDb()
 For Each tbl In db.TableDefs
     If Left$(tbl.Name, 4) = "dbo_" Then
        tbl.Name = Mid$(tbl.Name, 5)
     End If
 Next tbl

End Function
-------------------------------------------

All suggestions will be greatly appreciated

Thank You



Relevant Pages

  • Re: Code to delete/unlink Linked tables
    ... I need to be able to switch between the Live data tables and Test data ... >Dim tbl As DAO.TableDef ... existing link string: ...
    (microsoft.public.access.modulesdaovba)
  • UnHide All the Database Objects
    ... Does anyone know code to unhide all the hidden objects in the database? ... Public Function RenameTablesdbo() ... Dim tbl As DAO.TableDef ...
    (microsoft.public.access.modulesdaovba)
  • RE: sethiddenattribute - Tables
    ... Private Sub Form_Open ... Dim tbl As TableDef ... Dim strTblName As String ... For Each tbl In CurrentDb.TableDefs ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Code to rename tables
    ... Dim tbl As DAO.TableDef ... >>> For Each tbl In TableDefs ... >>> Gerald Stanley MCSD ...
    (microsoft.public.access.modulesdaovba)
  • Re: how to identify a given table
    ... and requires no parentheses if it ... Public Sub PopulateScheduleOfValues ... MWordTable.DeleteAllRowsButHeader tbl ... Dim tbl As Word.Table ...
    (microsoft.public.word.tables)