Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2006

Tip: Looking for answers? Try searching our database.

Code to delete all tables in an mdb

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim Pockmire - 01 Dec 2006 16:18 GMT
I can loop through all of the tables in tabledefs, but how can I test for
system tables?
BillCo - 01 Dec 2006 16:30 GMT
dim tbl as dao.tabledef

for each tbl in currentdb.tabledefs
if tbl.name like "MSys*" then debug.print tbl.name
next

> I can loop through all of the tables in tabledefs, but how can I test for
> system tables?
Allen Browne - 01 Dec 2006 16:30 GMT
Try:
       If (tdf.Attributes And dbSystemObject) = 0 Then

Signature

Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I can loop through all of the tables in tabledefs, but how can I test for
>system tables?
Douglas J. Steele - 01 Dec 2006 16:30 GMT
The following code will identify the non-system tables:

Sub ListTables()
Dim dbCurr As DAO.Database
Dim tdfCurr As DAO.TableDef

   Set dbCurr = CurrentDb()
   For Each tdfCurr In dbCurr.TableDefs
       If (tdfCurr.Attributes And dbSystemObject) = 0 Then
           Debug.Print tdfCurr.name
       End If
   Next tdfCurr
   Set dbCurr = Nothing

End Sub

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I can loop through all of the tables in tabledefs, but how can I test for
>system tables?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.