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!

Store query execution time in a table 1

Status
Not open for further replies.

MwTV

MIS
Mar 9, 2007
99
Have several update queries that will be set with Windows Scheduler to "run" at 2:00 A.M. in the morning.

Is there any way to capture the time that each query began, time that the query ended, and the number of records that were updated and store in a local Access table.

For example,

tblQueryExecution

Fields; QueryName, Date/TimeStarted, Date/TimeEnded, RecordsUpdated, RecordsAppended

 

Yes. Check the second parameter of the Execute method for the CurrentProject.Connection object to get the records affected.
Also use the adExecuteNoRecords ExecuteOptionEnum for speedy action queries.

And for start stop just do a myTime = Now() before and after the Execute method. It is not the exact axecution time of the query but the next closer to that should be a connection with events! WillExecute & ExecuteComplete to be exact

So create a function that has all your queries executed as mentioned. Create a macro that fires that function and then schedule to run a shortcut to your mdb using the macro command line start up option.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top