ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using ADO to CopyFromRecordset to another sheet (https://www.excelbanter.com/excel-programming/324678-using-ado-copyfromrecordset-another-sheet.html)

JJ

Using ADO to CopyFromRecordset to another sheet
 
I'm using ADO to retrieve records from a database. However, the records are
automatically being stored in sheet1. How do I specify which sheet I want
the records to be stored in. I am using the following line of code to copy
from the recordset...

Range("A1").CopyFromRecordset rst

Thank you inadvance!



Bob Phillips[_6_]

Using ADO to CopyFromRecordset to another sheet
 
Worksheets("Sheet2").Range("A1").CopyFromRecordset oRS
--

HTH

RP
(remove nothere from the email address if mailing direct)


"JJ" wrote in message
...
I'm using ADO to retrieve records from a database. However, the records

are
automatically being stored in sheet1. How do I specify which sheet I want
the records to be stored in. I am using the following line of code to

copy
from the recordset...

Range("A1").CopyFromRecordset rst

Thank you inadvance!





jojo

Using ADO to CopyFromRecordset to another sheet
 
I appreciate it, thanks!

"Bob Phillips" wrote:

Worksheets("Sheet2").Range("A1").CopyFromRecordset oRS
--

HTH

RP
(remove nothere from the email address if mailing direct)


"JJ" wrote in message
...
I'm using ADO to retrieve records from a database. However, the records

are
automatically being stored in sheet1. How do I specify which sheet I want
the records to be stored in. I am using the following line of code to

copy
from the recordset...

Range("A1").CopyFromRecordset rst

Thank you inadvance!







All times are GMT +1. The time now is 08:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com