Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Saving Recordsets

Using Excel 2000 under Win 2K Pro with ADO 2.5

Does Excel provide any easy way to copy the results of a database query (in
the form of an ADODB.Recordset object) onto a Worksheet? Any thing as easy
as assigning an array to a Range? Or do I have to loop through all the
Fields for each record and copy them "manually"?




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Saving Recordsets

Hi William,

Range("A1").CopyFromRecordset rsData
which uses part of the Excel Object Model (Range), and the CopyRecordset
method.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"William Barnes" wrote in message
...
Using Excel 2000 under Win 2K Pro with ADO 2.5

Does Excel provide any easy way to copy the results of a database query

(in
the form of an ADODB.Recordset object) onto a Worksheet? Any thing as easy
as assigning an array to a Range? Or do I have to loop through all the
Fields for each record and copy them "manually"?




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Saving Recordsets

Thanks for the prompt response, Bob. Just what I was looking for!

"Bob Phillips" wrote in message
...
Hi William,

Range("A1").CopyFromRecordset rsData
which uses part of the Excel Object Model (Range), and the CopyRecordset
method.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"William Barnes" wrote in message
...
Using Excel 2000 under Win 2K Pro with ADO 2.5

Does Excel provide any easy way to copy the results of a database query

(in
the form of an ADODB.Recordset object) onto a Worksheet? Any thing as

easy
as assigning an array to a Range? Or do I have to loop through all the
Fields for each record and copy them "manually"?




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Saving Recordsets

One other thing, now that I think of it. What about the reverse? Is there an
easy way to generate a Recordset from a Range object?
"Bob Phillips" wrote in message
...
Hi William,

Range("A1").CopyFromRecordset rsData
which uses part of the Excel Object Model (Range), and the CopyRecordset
method.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"William Barnes" wrote in message
...
Using Excel 2000 under Win 2K Pro with ADO 2.5

Does Excel provide any easy way to copy the results of a database query

(in
the form of an ADODB.Recordset object) onto a Worksheet? Any thing as

easy
as assigning an array to a Range? Or do I have to loop through all the
Fields for each record and copy them "manually"?




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Saving Recordsets

Don't think so William, you need to handle that.

By the way, on the original question, there is also the GetRows method that
load an RS into an array

arrayData = oRS.GetRows

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"WIlliam Barnes" wrote in message
...
One other thing, now that I think of it. What about the reverse? Is there

an
easy way to generate a Recordset from a Range object?
"Bob Phillips" wrote in message
...
Hi William,

Range("A1").CopyFromRecordset rsData
which uses part of the Excel Object Model (Range), and the CopyRecordset
method.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"William Barnes" wrote in message
...
Using Excel 2000 under Win 2K Pro with ADO 2.5

Does Excel provide any easy way to copy the results of a database

query
(in
the form of an ADODB.Recordset object) onto a Worksheet? Any thing as

easy
as assigning an array to a Range? Or do I have to loop through all the
Fields for each record and copy them "manually"?




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Saving Recordsets

Thanks again. I guess I'm not surprised since the CopyFromRecordset method
doesn't copy the field names.

"Bob Phillips" wrote in message
...
Don't think so William, you need to handle that.

By the way, on the original question, there is also the GetRows method

that
load an RS into an array

arrayData = oRS.GetRows

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"WIlliam Barnes" wrote in message
...
One other thing, now that I think of it. What about the reverse? Is

there
an
easy way to generate a Recordset from a Range object?
"Bob Phillips" wrote in message
...
Hi William,

Range("A1").CopyFromRecordset rsData
which uses part of the Excel Object Model (Range), and the

CopyRecordset
method.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"William Barnes" wrote in message
...
Using Excel 2000 under Win 2K Pro with ADO 2.5

Does Excel provide any easy way to copy the results of a database

query
(in
the form of an ADODB.Recordset object) onto a Worksheet? Any thing

as
easy
as assigning an array to a Range? Or do I have to loop through all

the
Fields for each record and copy them "manually"?




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem displaying recordsets in Excel Format David Alexander Excel Discussion (Misc queries) 2 February 27th 06 04:52 PM
how to create ado recordsets from rows of data? No Name Excel Programming 1 January 22nd 04 05:36 PM
Creating recordsets based on a range PO Excel Programming 1 December 11th 03 11:51 AM
Merging two och more recordsets PO Excel Programming 4 October 31st 03 04:55 PM
ADO Recordsets ibeetb Excel Programming 1 September 11th 03 11:12 PM


All times are GMT +1. The time now is 04:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"