Solved

How to Delete all Linked Tables in code?

Posted on 2008-06-14
3
371 Views
Last Modified: 2010-04-21
I need some robust code to enable me to delete all linked tables in my MDB, but leave all the non-linked tables as they are.
This should be easy...High points for a fast answer!
0
Comment
Question by:SOTA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 21786439

Sub dropLinkedTables()
Dim db As DAO.Database, x As Variant
    Set db = CurrentDb
    For Each x In db.TableDefs
        If Len(x.Connect) > 0 Then
            db.Execute "drop table [" & x.Name & "]"
        End If
    Next
End Sub
0
 

Author Comment

by:SOTA
ID: 21786489
Perfect!! Thanks capricorn1
0
 

Author Closing Comment

by:SOTA
ID: 31467230
Awesome as usual!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question