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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

VBA -- SQL 9
DoCmd RunSQL parameters 5
Suppress Messages 1
RunSQL 2
can you use select with DoCmd.RunSQL? 8
Class Module Choices 6
Form settings stored in a table 1
runsql code problem 3

Back
Top