RunSQL or Execute?

  • Thread starter Thread starter Frederick Wilson
  • Start date Start date
F

Frederick Wilson

Is there an advantage of using RunSQL over Execute?

What are the differences here?

Thanks,
Fred
 
Frederick Wilson said:
Is there an advantage of using RunSQL over Execute?

What are the differences here?

RunSQL basically runs the query "through Access" whereas Execute is talking more
directly to Jet. The result is that RunSQL will bring up the warning prompts
unless you add lines of code to suppress them and then turn them back on
afterwards. Execute does not do this.

Execute is easier to set up error handling for if you include the dbFailOnError
argument and might be marginally faster.

RunSQL (since it goes through Access) can use form references like
Forms!FormName!ControlName embedded directly in the SQL or query. Execute would
need an explicit parameter declared or else you would need to delimit the SQL
string so that Execute is passed the value of the reference instead of the
reference itself.

I almost exclusively use Execute myself.
 
Back
Top