S
SHA
I want to know how can I get, with VBA or Visual Script, the last time a table was updated, Wich property returns me that value?
Thanks,
Salvador Hernandez
Thanks,
Salvador Hernandez
SHA said:I want to know how can I get, with VBA or Visual Script, the last
time a table was updated, Wich property returns me that value?
Thanks,
Salvador Hernandez
SHA said:Dirk,
I tried your idea with the following code, but it did not work:
-----------------------------------------
'This is VBScript code
Set MyDB = CreateObject("ADODB.Connection")
'The ODBC Connection is called Transmisions
MyDB.Open "Transmisions"
'I want to know the last time table TransFor was modified
LastTime = MyDB.Table("TransFor").LastModified
MsgBox(LastTime)
MyDB.Close
SHA said:Dirk,
Thanks for your help, I get an error message like this "Microsoft
VBScript runtime error: 94, Invalid use of Null:'LastTime'", and this
happens in the line with the instruction "MsgBox LastTime".
Salvador
Dirk Goldgar said:If you want to know the last time any record in the table was added,
modified, or deleted, there is no property that gives that information.
The best you can do in that regard is either maintain a "LastModified"
date/time field in the table (but that doesn't help with deletions), or
else only allow the table to be updated by procedures that record audit
information in another table.
If instead you want to know when the table's *design* was last modified,
you can get that from a property of the DAO TableDef object; e.g.,
Dim db As DAO.Database
Set db = CurrentDb
Debug.Print db.TableDefs("Table1").LastUpdated
Set db = Nothing
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)