RunSQL Vs Execute ?

  • Thread starter Thread starter mscertified
  • Start date Start date
M

mscertified

What is the difference between (and is either preferred):

Docmd.RunSQL "SQL statement"

and

CurrentProject.Connection.Execute "SQL statement"
 
What is the difference between (and is either preferred):

Docmd.RunSQL "SQL statement"

and

CurrentProject.Connection.Execute "SQL statement"

One big difference is that the former does not let you trap errors, and the
latter does.
 
It's been so long since I've used RunSQL.

Doesn't it require SetWarning Off/On to prevent warnings as well?

--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
It's been so long since I've used RunSQL.

Doesn't it require SetWarning Off/On to prevent warnings as well?

Yep - that's another of its disadvantages vis a vis the Execute method.
 
And the .execute method allows you to get the 'records affected' count back -
which is sometimes very useful.
 
Back
Top