Geoff Codd
Registered User.
- Local time
- Today, 07:55
- Joined
- Mar 6, 2002
- Messages
- 190
Hi,
I have the following code
Which returns data from an SQL server, I need to know the quickest way to copy this into a table in access, I have tried reading the recordset line my line and adding to a table but this takes 15 mins, even though it only take 2 mins to open the SQL.
Any help is much appreciated as always.
Thanks in advance
Geoff
I have the following code
Code:
Cn.CursorLocation = adUseServer
Cn.Open "Driver={SQL Server};Server=MS-LON-APPS01;Database=Warehouse;Trusted_Connection=yes"
Cn.CommandTimeout = 400
strSQL = "SELECT [Opco Code], [SAP Account ID], [Customer Name], [Invoice Number], [Product Group 4 ID], " _
& "[seg], [Reporting Period], [Charge Period], [Calls], [Minutes], [Billing Currency Code], " _
& "[Revenue Post Disc & Adj (Billed)], [Revenue Post Disc & Adj (USD)] " _
& "FROM RRR_REVENUE INNER JOIN rsi_cst ON [SAP Account ID] = [sap_id] " _
& "WHERE ((([seg])='1' Or ([seg])='6' Or ([seg])='8') AND (([Reporting Period])='200607'));"
rs.Open strSQL, Cn, adOpenStatic, adLockReadOnly
Which returns data from an SQL server, I need to know the quickest way to copy this into a table in access, I have tried reading the recordset line my line and adding to a table but this takes 15 mins, even though it only take 2 mins to open the SQL.
Any help is much appreciated as always.
Thanks in advance
Geoff