Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005

    Unanswered: ado Retrieving records slowly

    I have an In-line sql statement that I'm running. When ran inside Sql managment studio (Sql Server 2005) it only take a second. when ran inside my application through ado it takes over 30 seconds and thus times out.

    Any reason why this would happen?

    Set InRs = CreateObject("ADODB.Recordset") ' TNA Added
    InRs.CursorType = adOpenDynamic
    InRs.CursorLocation = adUseClient
    InRs.LockType = adLockOptimistic

    ' If we specified a timeout, use the disposable connection. Otherwise, the master will suffice
    If Timeout > 0 Then
    InRs.ActiveConnection = oCN
    InRs.ActiveConnection = adoMCCon
    End If

    ' Get the bloody recordset...
    InRs.Open InSQL

  2. #2
    Join Date
    Sep 2003
    Where and what is your SQL statement? Also, you're using a clientside cursor ... Do you really need a Dynamic recordset? Are you planning on changing records thru this recordset?
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Jun 2004
    Arizona, USA
    In a client-side cursor, the entire table get copied to the ado client before any filtering takes place.

    Try changing the cursor to static, server-side.
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

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