Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA connected vs disconnected from network? | Excel Discussion (Misc queries) | |||
disconnected chart objects | Charts and Charting in Excel | |||
How query a disconnected ADO recordset - possible? | Excel Programming | |||
Type recordset/recordset? | Excel Programming |