Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Dates objects are created or mofified...

Posted on 2014-03-25
4
Medium Priority
?
138 Views
Last Modified: 2014-04-11
I need a routine to run in an access database to list objects created along with their created and modified dates.

Question: Do you have a routine like this or can you put together if not very involved?

Thank you.
0
Comment
Question by:Mike Eghtebas
[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
4 Comments
 
LVL 46

Expert Comment

by:aikimark
ID: 39954544
If you just need that information about tables and queries, you can use this:
Public Sub IterateTablesAndQueries()
    Dim td As TableDef
    Dim qd As QueryDef
    For Each td In DBEngine(0)(0).TableDefs
        Debug.Print td.Name, td.DateCreated, td.LastUpdated
    Next
    For Each qd In DBEngine(0)(0).QueryDefs
        Debug.Print qd.Name, qd.DateCreated, qd.LastUpdated
    Next
End Sub

Open in new window

0
 
LVL 46

Accepted Solution

by:
aikimark earned 1000 total points
ID: 39954575
This will pick up tables, queries, forms, and reports
Public Sub IterateAllObjects()
    Dim rs As Recordset
    Set rs = DBEngine(0)(0).OpenRecordset("Select name, DateCreate, DateUpdate from msysobjects where flags=0 and type in (1,5,-32768,-32764)")
    Do Until rs.EOF
        Debug.Print rs!Name, rs!datecreate, rs!dateupdate
        rs.MoveNext
    Loop
End Sub

Open in new window

Note: You will get the system tables if you remove the flags=0 condition in the Where clause.
0
 
LVL 48

Assisted Solution

by:Dale Fye
Dale Fye earned 600 total points
ID: 39954587
which objects?  You can use something like:

SELECT [TYPE],[Name], [Owner], DateCreated, DateUpdated
FROM mSysObjects

But that will give you all objects.  To get more specific, you would need to use the [Type] field to restrict that to the specific types of objects.

Tables: 1 (local), 6 (Linked)
Forms: -32768
Reports: -32764
Queries: 5
Modules: -32761
0
 
LVL 39

Assisted Solution

by:PatHartman
PatHartman earned 400 total points
ID: 39954626
There is no reliable method since Access changes the create and modified dates of some objects whenever you compact.  The create date usually survives but who among us has never had to rebuild a database due to corruption - there goes your create dates.

Do some testing so you understand when Access will change these dates on you.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
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 …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

610 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