AlexTeslin
Registered User.
- Local time
- Today, 03:28
- Joined
- Jul 10, 2008
- Messages
- 55
Hi,
I have a SQL query written in Excel VB Module, which generates the data and stores in Recordset. Like this:
Set rst = New ADODB.Recordset
rst.CursorLocation = adUseClient
rst.Open sqlString, connectionVar, adOpenKeyset, adLockPessimistic
With this I can copy the data into Excel worksheet like this:
Cells(1,1).CopyFromRecordset rst
Now, instead of copying the data from query into Excel worksheet, I would like to copy that data into another table in Access. I have already created an Access file and a table for it. I also made a connection to the file from the Excel Module as i did for SQL Server.
How can I now copy the data to the specified table? I can implement INSERT INTO query, but how can I use my data which is stored in Recordset variable rst?
Any help will be much appreciated, thank you
I have a SQL query written in Excel VB Module, which generates the data and stores in Recordset. Like this:
Set rst = New ADODB.Recordset
rst.CursorLocation = adUseClient
rst.Open sqlString, connectionVar, adOpenKeyset, adLockPessimistic
With this I can copy the data into Excel worksheet like this:
Cells(1,1).CopyFromRecordset rst
Now, instead of copying the data from query into Excel worksheet, I would like to copy that data into another table in Access. I have already created an Access file and a table for it. I also made a connection to the file from the Excel Module as i did for SQL Server.
How can I now copy the data to the specified table? I can implement INSERT INTO query, but how can I use my data which is stored in Recordset variable rst?
Any help will be much appreciated, thank you