Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2009
    Location
    Up Nort' Wi
    Posts
    140

    Unanswered: Opinion: Db.Execute or DoCmd._RunSQL?

    Which statement is the most preferred as far as performance and system overhead?

    When I got my programming degree (eons ago it seems), we were trained in Access 2k (along with Oracle), we were taught the DoCmd._RunSQL with no exposure at all to dbEngine (0)(0).Execute (which, of course, I stumble upon today).

    Is one actually better than the other or is it a matter 6 of one, half dozen of the other and it's all in the programmer's personal preference?

    I've been writing my app with the DoCmd, but, can quite easily change over to the execute if there's going to be a significant change in performance (50+ users hitting the DB in a local fe/server held be.

    Just seeing what everyone else is using and why,

    Thanks,

    Sam, only thing I learned in college was how little I actually know.
    Good, fast, cheap...Pick 2.

  2. #2
    Join Date
    Mar 2007
    Posts
    277
    I tend to use CurrentDB.Execute for my action queries, mostly because there are no warnings, only errors reported.
    RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP, ac07, ac10 - WinXP Pro, Win7 Pro
    Please reply to this forum so all may learn.

  3. #3
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    I tend to use docmd.openquery method myself.

    It's more of a personal preference than anything. There are a couple of small differences such as I believe the .execute gives an error if performing something like a make-table query if the table already exists while a docmd.openquery asks if you want to over-write the table. Each has it's advantage in some small way but the goal is accomplished. Even while working with large datasets, I didn't see an advantage of one over the other although I believe the .Execute is a little bit faster (but it wasn't extremely noticable.)
    Last edited by pkstormy; 09-28-09 at 22:31.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  4. #4
    Join Date
    Aug 2009
    Location
    Up Nort' Wi
    Posts
    140
    Good stuff, thanks for the insight.

    Sam
    Good, fast, cheap...Pick 2.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •