Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


speed up select distinct - access database and vb6 classic


speed up select distinct - access database and vb6 classic

Author
Message
sal21
sal21
Forum God
Forum God (4.3K reputation)Forum God (4.3K reputation)Forum God (4.3K reputation)Forum God (4.3K reputation)Forum God (4.3K reputation)Forum God (4.3K reputation)Forum God (4.3K reputation)Forum God (4.3K reputation)Forum God (4.3K reputation)

Group: Forum Members
Posts: 20, Visits: 63
I need to speed up this sql select distinct:



my conn:



Public Sub APRI_CONNESSIONE3()



On Error GoTo Err_SomeName



Set CONN3 = Nothing

Set CONN3 = New ADODB.Connection

With CONN3

.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\REPORT_L0\DATABASE\" & MIO_DB & "-L0_TEST.mdb;Persist Security Info=False"

End With



Exit_SomeName:

Exit Sub



Err_SomeName:

MsgBox Err.Number & Err.Description

Resume Exit_SomeName



End Sub





my select distinct:



Set RST0 = Nothing

Set RST0 = New ADODB.Recordset

RST0.CursorLocation = adUseClient

'RST0.CacheSize = 500



SQL = "SELECT DT FROM L0_SI WHERE (CONTAB='" & TEST_CONTAB & "') GROUP BY DT"

DoEvents

RST0.Open SQL, CONN3, adOpenForwardOnly, adLockReadOnly, adCmdText





note:



- CONTAB and DT fields are indexed

- records in table are approx 1.500.xxx
Edited
1/16/2012 by sal21
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search