[AccessD] Technical test for developers

Gustav Brock gustav at cactus.dk
Wed May 14 06:32:06 CDT 2003


Hi Stuart

> For debugging purposes, it's a lot easier if you use a string
> variable. If something breaks, you can do a MsgBox strSQL to see 
> where it has gone wrong.
> Using the SQL statement directly is an advantage if you are
> iterating through a loop and executing may times. It runs slightly
> faster. 

Ahh Stuart - I would like to see that application where you can
measure ANY difference between these:

  db.Execute "INSERT INTO tblUpdateLog (ulDate, ulRecordCount ) VALUES (
  #" & Date & "#, " & FlagCount & ") "
  ---------------------------
  Dim strSQL As String
  strSQL = "INSERT INTO tblUpdateLog (ulDate, ulRecordCount ) VALUES (
  #" & Date & "#, " & FlagCount & ") "
  db.Execute strSQL

as the time for setting a string variable is in the microsecond range.

Use of strSQL is also a nice coding habit which make the code easier
to read. Quite often you can even brake it further:

  strSQL = "INSERT INTO tblUpdateLog (ulDate, ulRecordCount ) "
  strSQL = strSQL & "VALUES (#" & Date & "#, " & FlagCount & ") "

/gustav



More information about the AccessD mailing list