Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List all DB Objects

Status
Not open for further replies.

Moxy1

Programmer
Aug 29, 2002
75
US
is there any code that can list out all tables, queries, forms, reports, macros and modules so I can capture all the object names and their modify date?
 
Thanks for the response. I've been able to find the pieces that I need to scan the current database. Is there a way to incorporate this to scan a list of databases?

The goal would be to have a table listing the location and names of the databases to be scanned. The code will loop through this listing and capture all forms/reports with their modify date.
 
sorry about that. Apparently I just needed a couple more minutes to figure this out.

Thanks
 
How are ya Moxy1 . . .

For those who were following this thread, could you post what you came up with? [surprise]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Code:
Public Function Find()

Dim db As Database            
Dim cnt As Container          
Dim doc As Document           
Dim intCount As Integer           
Dim strForm As String
Dim strDate As String
Dim strDest As String

strDest = "database location" 'to be replaced with a recordset
        

    Set db = OpenDatabase(strDest)
        
        ' ******** Forms ********
            Set cnt = db.Containers!Forms
            If cnt.Documents.Count > 0 Then
                For Each doc In cnt.Documents
                    strForm = doc.Name
                    strDate = doc.LastUpdated
                    MsgBox strForm & vbCr & strDate
                Next doc
            
            End If
            

End Function
 
Still think that a brief review of MSysObjects provides all the relevant information. No code necessary, just a single query. Lists all db objects, includes the object type and -for tables- the external db they are linked from ...



MichaelRed


 
Moxy1 . . .

I agree with [blue]MichaelRed[/blue]!, as [blue]MSysObjects[/blue] contains all objects in a Db! ... plus others you never knew existed!

An SQL using a variable [blue]In Clause[/blue] (for each Db) using [blue]MSysObjects[/blue] is all you need! . . .

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top