Hi Folks
I have to import large amount of data from remote database into local access tables using ADO and DAO via ODBC - the data involves about 2 million rows in one table, if the data is not that large it goes smoothly otherwise it results in out of memory error, is there a more effecient way of doing this, here is the code I am using :
---
I have to import large amount of data from remote database into local access tables using ADO and DAO via ODBC - the data involves about 2 million rows in one table, if the data is not that large it goes smoothly otherwise it results in out of memory error, is there a more effecient way of doing this, here is the code I am using :
---
Code:
---
Dim Rs As New ADODB.Recordset
Dim sqlBillData As String
sqlBillData = "SELECT field1, field2, ...fieldn FROM remote_table"
Set Rs = cPostgreSQL.Execute(sqlBillData, , adOpenForwardOnly)
Do Until Rs.EOF
oConn.Execute "INSERT INTO local_table ([field1],[field2], ...[fieldn] " & _
"VALUES(" & Rs![field1] & ",'" & Rs![field2] & "'," & ... Rs!fieldn & ",'" & ")"
Rs.MoveNext
Loop
Set Rs = Nothing
---[Code]---