Opening Stored Procedure...copying to local table...any faster way to do this?



I use ADO to access a SQL Server 2000 stored procedure that returns
values. The code is as follows:


Dim Agency As String
Dim rs As DAO.Recordset
Dim conn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs2 As ADODB.Recordset
Dim rs3 As DAO.Recordset
Dim rowcounter As Long
Dim style As String
Dim i As Long
Dim filterstring As String
Dim xlObj As Object
Dim xl*** As Excel.Work***
Dim xlbk As Excel.Workbook
Dim qdf As DAO.QueryDef

Agency = Me.cboAgency
..
...
....
CurrentDb.Execute "DELETE FROM SalesSummaryTable"
Set qdf = CurrentDb.QueryDefs("PullAgencySummaries")
qdf.Parameters(0) = Me.cboAgency
qdf.Execute
'CurrentDb.QueryDefs("PullAgencySummaries").Execute
CurrentDb.Execute "DELETE FROM tblForWork***"
CurrentDb.Execute "DELETE FROM tblSalesmanBooked"
Set rs3 = CurrentDb.OpenRecordset("tblForWork***")
Set conn = New ADODB.Connection
conn.ConnectionString =
"Provider=SQLOLEDB.1;Password=brent;Persist Security Info=True;User
ID=sa;Initial Catalog=ee8idbbd;Data Source=JOMAR"
conn.Open
Set cmd = New ADODB.Command
cmd.ActiveConnection = conn
cmd.CommandType = adCmdStoredProc
cmd.CommandTimeout = 300
cmd.CommandText = "bdg_proc_BookingsByStyleAgency"
cmd.Parameters(1) = CStr(Me.cboAgency)
Set rs2 = cmd.Execute
'rs2.Filter = "CUSTOMER = '" & Me.cboAgency & "'"
If Not rs2.EOF Then
'rs2.MoveFirst
Do Until rs2.EOF
rs3.AddNew
rs3!style = rs2!style
rs3!Agency = Me.cboAgency
rs3![04Booked] = rs2!BookedFor04
rs3![05Booked] = rs2!BookedFor05
rs3![06Booked] = rs2!BookedFor06
rs3.Update
rs2.MoveNext
Loop
End If


And then the code goes on and does other stuff.

Is this the best way to do it? I hate to keep the connection open that
long and tie a connection up on the SQL Server. Does Access or ADO
have a bulk copy procedure call that could just dump the resultant
contents into the local Access table?

.