Solved

How to Delete all Linked Tables in code?

Posted on 2008-06-14
3
367 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
  • 2
3 Comments
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 250 total points
Comment Utility

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
Comment Utility
Perfect!! Thanks capricorn1
0
 

Author Closing Comment

by:SOTA
Comment Utility
Awesome as usual!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now