none
completed RRS feed

All replies

  • I'm not really sure what you are doing here. It appears you are mixing ADO and DoCmd, but the code doesn't really make any sense. What is MyRun2? On which line of code does the error occur?

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Monday, June 5, 2017 8:39 PM
  • Thanks! it completed


    • Edited by hwei2009 Wednesday, July 12, 2017 6:36 PM
    Monday, June 5, 2017 9:33 PM
  • You don’t really need to convert your existing code. It should run just fine as DAO.
    I suppose if the sql update was “large” and updates a lot of rows, then you  could consider using a pass-through query.

    So while converting to ADO can help, I would not convert unless the existing code runs poorly.

    And by using DAO, then you continue to use existing linked tables, and existing code that worked before likely will continue to work – about the only line of code is the openRecordSet command that you had in DAO.

    And what is nice about using the DAO is you don’t have to bother with connection strings in code – which can become a little messy.

    So I don’t want to 100% discourage you from using ADO, but you likely not really gain much in performance for a simple update. And introducing changes to existing code that's been working for years will often break. I tend to find the trade off in extra work is not worth it unless performance issues rears its ugly head.

    I leave "most" of the existing code as DAO. And for performance I go with PASS through queries - the result is no connection strings in code, and I don't adopt nor introduce ADO into the application. It really depends on how much existing code you have - but I recommend you don't touch or re-write the DAO code.

    Regards,
    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada

    Tuesday, June 6, 2017 12:55 AM
  • Thanks!
    Wednesday, July 12, 2017 6:36 PM
  • Hi hwei2009,

    I find that your issue is solve so you had edited the original post and one reply.

    if your issue is solved then try to mark the suggestion as an answer which helped you to solve your issue.

    you edited the original post.

    now no one can see what the issue was and still thread is in pending.

    I suggest you to again edit the original post and change it to your issue.

    so that in future if someone meet with this kind of issue then they can get solution from this thread.

    also I suggest you to mark the correct answer which solve your issue , so that we can close this thread on our side.

    if you do not mark the answer then this thread will remain pending on our side.

    please , take the appropriate actions.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, July 13, 2017 1:46 AM
    Moderator