Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Perform SQL command on Disconnected ADO Recordset

I have an ADO recordset that I created by declaring it as new and
adding all of the columns and data manually. I want to be able to
perform a SQL string on it to do aggregation and other things that SQL
provides. Is there anyway to do this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Perform SQL command on Disconnected ADO Recordset

A recordset is the result of a query, so you can't really query it. You will
need to use code to extract the values you need (or to step through and
calculate your aggregates). This is a bit of a hassle, but not too bad. The
Filter property can help here, as well as the Find method. Then a simple
loop through the recordset can retrieve or add or otherwise manipulate the
values.

"R Avery" wrote:

I have an ADO recordset that I created by declaring it as new and
adding all of the columns and data manually. I want to be able to
perform a SQL string on it to do aggregation and other things that SQL
provides. Is there anyway to do this?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Perform SQL command on Disconnected ADO Recordset

I tend to use ADO against a database connection, but I believe that you can
also use it to query a closed workbook, so

1. where is the data coming from? if from a workbook in a reasonable data
structure, you could just query the closed workbook.
2. if not, you could use copyfromrecordset to put the data in a workbook,
save the book, then query the book.

I don't have time to work up an example right now I'm afraid, but the
suggestion might get you headed in the right direction.

Robin Hammond
www.enhanceddatasystems.com


"K Dales" wrote in message
...
A recordset is the result of a query, so you can't really query it. You
will
need to use code to extract the values you need (or to step through and
calculate your aggregates). This is a bit of a hassle, but not too bad.
The
Filter property can help here, as well as the Find method. Then a simple
loop through the recordset can retrieve or add or otherwise manipulate the
values.

"R Avery" wrote:

I have an ADO recordset that I created by declaring it as new and
adding all of the columns and data manually. I want to be able to
perform a SQL string on it to do aggregation and other things that SQL
provides. Is there anyway to do this?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Perform SQL command on Disconnected ADO Recordset

The data is coming from an open workbook, and the range i want to get
it from can start with any upperleft cell. The purpose of this is to
have all data centralized in a single place, and just create random
QueryRange() views on different worksheets.

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
VBA connected vs disconnected from network? TSW632 Excel Discussion (Misc queries) 1 November 14th 08 05:14 AM
disconnected chart objects KenRogers Charts and Charting in Excel 0 August 5th 08 08:03 PM
How query a disconnected ADO recordset - possible? quartz[_2_] Excel Programming 5 December 2nd 04 09:02 AM
Type recordset/recordset? FlaviusFlav[_9_] Excel Programming 4 May 24th 04 12:16 PM


All times are GMT +1. The time now is 07:40 PM.

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

About Us

"It's about Microsoft Excel"