Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2011
    Location
    Houston, TX
    Posts
    32

    Cool Unanswered: DoCmdRunSQL vs DoCmdOpenQuery

    Simple question: which one of these is more efficient, do you think?

    Code:
    DoCmd[dot]RunSQL("DELETE * FROM tblCustomers")
    Or

    Code:
    DoCmd.OpenQuery "qryDelCustomers", acViewNormal, acEdit

    ...any thoughts?

    Also, I just...typed in [dot] there because dbForums kept bleeping out my text for some reason .

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if you are deleting rows, then use RunSQL as you don't need a recordset to be returned
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Nov 2011
    Location
    Houston, TX
    Posts
    32
    The question isn't specifically which is better for DELETING RECORDS. Your answers are vapid and insubstantial.

    My question is is you're performing transactions, which would you think would be a more efficient way to do it? Writing a stored query and calling it with DoCmd.OpenQuery, or just stuffing the SQL into a string and calling DoCmd RunSQL

    Personally, I'm leaning toward Execute now.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    If you are getting vague answers then perhaps you'd be better off asking yourself if you are giving sufficient information in your original posts. And if you are not then there is stuff all point in getting ornery if you get a response which answers your question (or at least the one you posted as opposed to he one in your head).

    executing SQL that returns no rows will be more efficient using runSQL. whether you will actually notice any 'efficiency' or 'performance' gains is doubtful. I guess if you want to prove it either way then you could run some metrics and report back
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Nov 2011
    Location
    Houston, TX
    Posts
    32
    Actually friend, you just need to learn how to read critically and determine what the question actually is before just firing shit off the cuff.

    Although I guess you have a point. Maybe my question wasn't phrased properly. I ask which is more efficient then blurt out two DELETE statements, when I should have just asked is ****nSQL or .OpenQuery more efficient.

    Thank you for your constructive criticism.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    firing shit off the cuff, lets not go there.....
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Nov 2011
    Location
    Houston, TX
    Posts
    32
    He didn't ready anything after the first sentence.

Posting Permissions

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