|
-
Jan 12th, 2000, 09:44 PM
#1
Thread Starter
New Member
Does anybody out there know how I can import the contents of an ADO recordset into an excell worksheet. There is a CopyFromRecordset method but it only supports DAO recordsets (Excel 97 dont know about 2000). I will step through the recordset and insert each row individually but I cannot even find out how to insert a string into a cell????
-
Jan 13th, 2000, 02:18 AM
#2
New Member
to put a string in a cell use
Sheet1.cells(row, col) = "my text"
-
Jan 13th, 2000, 04:43 AM
#3
Member
Look up the 'GetRows' method in the ADO documentation. It allows you to assign the contents of an entire recordset to something else (like an array, etc.)
I haven't tried this with Excel, but it should go something like this:
Worksheets("Sheet1").Range("A1") = RS.GetRows(X)
Where X is the number of rows you want to retrieve from your recordset. This would assign the contents of your recordset to the Range beginning at cell A1.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|