GETROW very slow

User avatar
sal21
PlatinumLounger
Posts: 4353
Joined: 26 Apr 2010, 17:36

GETROW very slow

Post by sal21 »

This takes around 4 minutes to do it!!!! Perphs i nee to set the cursor with different param?

my pseudo code:

Code: Select all

Set RS = New ADODB.Recordset
    RS.CursorLocation = adUseClient
    
    SQL = "SELECT DB_CARTE.NOMINATIVO, DB_CARTE.IMPORTO, DB_CARTE.NR, DB_CARTE.SPORT, DB_CARTE.CC, DB_CARTE.NDG, DB_CARTE.RAPPORTO, DB_CARTE.CARTA, DB_CARTE.SETT, DB_CARTE.MINDATA, DB_CARTE.MAXDATA, TUTTI_CC_DAILY.ACCE, DB_CARTE.H, DB_CARTE.D, DB_CARTE.NATO FROM DB_CARTE INNER JOIN TUTTI_CC_DAILY ON DB_CARTE.RAPPORTO = TUTTI_CC_DAILY.RAPPORTO" & _
    " WHERE Not (DB_CARTE.SETT) Is Null And DB_CARTE.D > 0 And Not (DB_CARTE.NATO) Is Null And DB_CARTE.DATA_RIF Is Null And DB_CARTE.MAXDATA>=#" & Format(DATE1, "MM/DD/YYYY") & "#"
    'Debug.Print SQL
    RS.Open SQL, CONN, adOpenStatic, adLockReadOnly, adCmdText

        Dim strDBRows() As Variant
        Sleep (300)
        Erase strDBRows()
        strDBRows = RS.GetRows()
        RS.Close
        Set RS = Nothing

....
my conn:

Code: Select all

If CONN Is Nothing Then
        strProvider = "Provider=Microsoft.Jet.OLEDB.4.0;"
        If Not (ENVIOR = "SS-72D68331754B" Or ENVIOR = "UTENTE-PC") Then
            strSource = "Data Source=\\00058\work\107\GO\DATABASE\T1.mdb;"
        Else
            strSource = "Data Source=C:\DATABASE\T1.mdb;"
        End If
        strConnection = strProvider & strSource & "Persist Security Info=False"
        Set CONN = New ADODB.Connection
        CONN.Open strConnection
    End If
note:
All fields with "where" are indexed
The access atabase in over network dir

User avatar
HansV
Administrator
Posts: 78443
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: GETROW very slow

Post by HansV »

Does it make a difference whether you open the database on the C: drive or the database on the network drive?
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4353
Joined: 26 Apr 2010, 17:36

Re: GETROW very slow

Post by sal21 »

HansV wrote:Does it make a difference whether you open the database on the C: drive or the database on the network drive?
Tks for suggestion but i cannot test now, tomorrow... in my office.