+ Reply to Thread
Results 1 to 3 of 3

VBA addin - ODBC via ADO compared to DAO

  1. #1
    Registered User
    Join Date
    07-20-2011
    Location
    Missouri, USA
    MS-Off Ver
    Excel 2007
    Posts
    36

    VBA addin - ODBC via ADO compared to DAO

    I have a vba addin that was originally created in DAO format and it is really quick, problem is that this addin needs to be shared to a lot of ppl and we need to a lot of setup to get DAO to function correctly within Excel 2007, so I am trying to switch the addin to ADO. The speed in ADO is terrible compared to the DAO. The DAO does 4800 records in about 36 seconds and ADO is doing the same amount of records in 30 minutes.

    DAO setup:
    Please Login or Register  to view this content.
    Current ADO setup:
    Please Login or Register  to view this content.
    I could like to get the if statement working if I can

    Function call for DAO:
    Please Login or Register  to view this content.
    ADO Function call:
    Please Login or Register  to view this content.

    Any help will be greatly appreciated!
    Last edited by popfan; 01-10-2012 at 11:08 AM.

  2. #2
    Registered User
    Join Date
    07-20-2011
    Location
    Missouri, USA
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: VBA addin - ODBC via ADO compared to DAO

    I found the answer in PRO VBA 2007 book. I had to change:

    rs.Open sSQL, cnn, adOpenKeyset, adLockOptimistic
    to
    rs.Open sSQL, cnn, adOpenDynamic

  3. #3
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: VBA addin - ODBC via ADO compared to DAO

    Why does DAO take more work to set up than ADO?
    Incidentally, if you are simply reading values from the recordset, a firehose cursor is usually the fastest

    Please Login or Register  to view this content.
    Last edited by OnErrorGoto0; 01-10-2012 at 11:22 AM.
    Good luck.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1