This Tech Tip shows a simple way of keeping a log file of when a structure or data file is opened and closed. This basically involves executing a Project Method during the startup and shutdown of the database. The log for the structure file is stored in a list and the log for the data file is stored in a table created for that purpose. The log keeps track of the last 15 times the file was opened and closed.
1) Create a table [Open_Log_Table].
2) Create an Alpha field, to store 40 Characters, called "Entry".
3) Create a method called "DB_Open_Log" and copy the method from this tech tip into the method (see below for a cut /paste copy)
` Method: DB_Open_Log ("") - keeps track of when the database is opened
` for both structure and data files
$text:=String(Current date;Short)+" - "+String(Current time;HH MM)+": "+$1
LIST TO ARRAY("Open_Log";$log)
If (Size of array($log)>$count)
ARRAY TO LIST($log;"Open_Log")
If (Records in table([Open_Log_Table])<$count)
4) Enter the line "DB_Open_Log ("Open")" On Startup Method.
5) Enter the line "DB_Open_Log ("Close")" On Exit Method.