querying a query(recordset object) [ADO] 
Author Message
 querying a query(recordset object) [ADO]

Hi,
I have created a recordset object which is bound to a datagrid. I need
to bind only some of that data to an MSchart.

So can I query my datagrid's recordset to cut it down into a new
recordset for the chart?

Thanks,
ozi



Tue, 27 May 2003 03:00:00 GMT  
 querying a query(recordset object) [ADO]
Use recordset.Filter


Tue, 27 May 2003 22:53:31 GMT  
 querying a query(recordset object) [ADO]
Hi,
I have created a recordset object which is bound to a datagrid. I need
to bind only some of that data to an MSchart.

So can I query my datagrid's recordset to cut it down into a new
recordset for the chart?

Thanks,
ozi



Wed, 28 May 2003 00:45:37 GMT  
 querying a query(recordset object) [ADO]

Quote:

> Ozi:

> Have a look at the Filter property and Clone method of the ADO
> recordset object.

> Regards,
> -Toby


> >Hi,
> >I have created a recordset object which is bound to a datagrid. I need
> >to bind only some of that data to an MSchart.

> >So can I query my datagrid's recordset to cut it down into a new
> >recordset for the chart?

> >Thanks,
> >ozi

Is this the most efficient way? ie. to clone the recordset and delete
the unwanted fields.

Thanks,
ozi



Wed, 28 May 2003 00:45:38 GMT  
 querying a query(recordset object) [ADO]
Ozi:

DEFINITELY do not delete anything from the Clone: the parent recordset
will be affected as well.  Perhaps what you should be looking at is
the GetRows method of the RecordSet object - sorry for my previous
post as it was misleading.

If the columns in your recordset which you want to plot are (for
example) "EmployeeName" and "Salary", you can use the GetRows method
to extract only those columns to an array:

aRay =  YourRecordSet.GetRows(, , Array("EmployeeName", "Salary"))

You'll then have to do some manipulations with the array (aRay)
returned:

Dim nRows As Integer
Dim nCols As Integer
Dim nR As Integer
Dim nC As Integer
nCols = UBound(aRay)
nRows = UBound(aRay, 2)
Dim aChrt() As Variant
ReDim aChrt(nRows, 0 To nCols)
For nC = 0 To nCols
 For nR = 0 To nRows
  aChrt(nR, nC) = aRay(nC, nR)
 Next
Next

MSChart1.ChartData = aChrt

Regards,
-Toby

Quote:


>> Ozi:

>> Have a look at the Filter property and Clone method of the ADO
>> recordset object.

>> Regards,
>> -Toby


>> >Hi,
>> >I have created a recordset object which is bound to a datagrid. I need
>> >to bind only some of that data to an MSchart.

>> >So can I query my datagrid's recordset to cut it down into a new
>> >recordset for the chart?

>> >Thanks,
>> >ozi

>Is this the most efficient way? ie. to clone the recordset and delete
>the unwanted fields.

>Thanks,
>ozi



Wed, 28 May 2003 17:48:24 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. querying a query(recordset object) [ADO]

2. Query agains an ADO recordset object

3. Querying ADO Recordset Object

4. query a query recordset?

5. query a query recordset?

6. Query Object vs VBA Query

7. ADO Read-write parameter query recordsets

8. query of an ADO recordset

9. Updateable recordsets from parameterised queries in ADO

10. can you query an ADO recordset?

11. Trying to pass a variable in an ADO recordset query

12. Query an ADO Recordset?

 

 
Powered by phpBB® Forum Software