I use the tipical ado connection and VB& to set an Access MDB.
Into table1 are approx 180.000Code:Public Sub CHECK_CONNESSIONE() ENVIOR = "" ENVIOR = VBA.Environ("COMPUTERNAME") If CONN Is Nothing Then If ENVIOR = "SS-72D68331754B" Or ENVIOR = "MY-F554C8E61153" Then Set CONN = New ADODB.Connection With CONN .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ASS_MF\DATABASE\BA.mdb;Persist Security Info=False" .CommandTimeout = 0 .CursorLocation = adUseClient .Open End With Else Set CONN = New ADODB.Connection With CONN .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\1234567\345677$\FSRM107\Ge_O\DATABASE\BA.mdb;Persist Security Info=False" .CommandTimeout = 0 .CursorLocation = adUseClient .Open End With End If End If End Sub
into table are a filed named DATES (is just indexed, dupes YES)
i open the recordset of DATES (as date short) with to select distinct dates:
SP query:Code:Dim objCommand As ADODB.Command Set objCommand = New ADODB.Command With objCommand .ActiveConnection = CONN .CommandText = "SP" .CommandType = adCmdStoredProc Set RS = .Execute Set objCommand = Nothing End With
possible the time to return recordset is approx 5 minutes??????????????????????????'Code:SELECT TOT.DATA_OPE, TOT.SP_MF FROM TOT_ASSEGNI GROUP BY TOT.DATA_OPE, TOT.SP_MF HAVING (([TOT].[SP_MF]="SP"));


Reply With Quote