Re: Rowsets
Alan Gamboa <[email protected]> Tue, 4 Feb 2003 10:40:09 -0500
| Newsgroups | gmane.comp.windows.devel.oledb.devel |
|---|---|
| Message-ID | <[email protected]> |
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C2CC63.B2DFB870
Content-Type: text/plain;
charset="iso-8859-1"
Just another thought can a row be removed from a rowset? or a record from an
ADO Recordset?
-----Original Message-----
From: Mark Dawson [mailto:[email protected]]
Sent: Tuesday, February 04, 2003 4:24 AM
To: [email protected]
Subject: Re: [OLEDB_DEV] Rowsets
Alan,
Off the top of my head I can think of 2 ways of doing this.
The first is to use ADO to build a new recordset that matches the original;
copy accross the data and then grab hold of the Recordset objects internal
Rowset pointer. This gives you a Client Cursor Engine Rowset that contains
the data you requested.
The second it to write yourself a Rowset object using the ATL templates that
does effectively the same thing: you give your rowset class a pointer to
another rowset which it copies the column definitions of. You could also
have this rowset initialise itself with the data you want populated by
applying a filter to the rowset beforehand and passing the chapter handle to
the initialisation routine (assuming the records you want _can_ be filtered
out and that you're using a source rowset that supports filters).
Both methods are relatively simple to do, but can be quite time consuming
with large data sets. Obviously in this case, applying filters in CCE is
going to be far more efficient than scanning rowsets on your own. Other
than this I honestly can't say which is 'best' as it depends on what your
intended use of the copied rowset actually is. In fact what is a better
solution than both of these is if you don't actually need a 'copy' of the
rowset and can simply get away with applying filters to the original and
keeping hold of the chapter handles for later use. I do this frequently.
Mark
--------------------------------------------------------------
Mark Dawson ([email protected])
Software Project Leader
SRH Systems Ltd.
Lowesmoor Wharf, Worcester.
WR1 2RS. UK
+44 (0)1905 613361
-----Original Message-----
From: Alan Gamboa [mailto:[email protected]]
Sent: 03 February 2003 15:32
To: [email protected]
Subject: [OLEDB_DEV] Rowsets
I have a query:
select f1,f2,f3 from t1 where f1 = 1
this query returns a rowset of 50 records.
I want create a new rowset that contains some of the records in the above
rowset, what is the best way to do this?
thanks.
Alan Gamboa
CCG Systems, Inc.
You can read messages from the OLEDB_DEV archive, unsubscribe from
OLEDB_DEV, or subscribe to other DevelopMentor lists at
http://discuss.develop.com.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________
You can read messages from the OLEDB_DEV archive, unsubscribe from
OLEDB_DEV, or subscribe to other DevelopMentor lists at
http://discuss.develop.com.
You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.
------_=_NextPart_001_01C2CC63.B2DFB870
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Rowsets</TITLE>
<META content="MSHTML 6.00.2800.1126" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=234124115-04022003><FONT face=Arial color=#0000ff size=2>Just
another thought can a row be removed from a rowset? or a record from an ADO
Recordset?</FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Mark Dawson
[mailto:[email protected]]<BR><B>Sent:</B> Tuesday, February 04, 2003
4:24 AM<BR><B>To:</B> [email protected]<BR><B>Subject:</B> Re:
[OLEDB_DEV] Rowsets<BR><BR></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=643571609-04022003>Alan,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=643571609-04022003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=643571609-04022003>Off
the top of my head I can think of 2 ways of doing this.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=643571609-04022003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=643571609-04022003>The
first is to use ADO to build a new recordset that matches the original; copy
accross the data and then grab hold of the Recordset objects internal Rowset
pointer. This gives you a Client Cursor Engine Rowset that contains the
data you requested.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=643571609-04022003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=643571609-04022003>The
second it to write yourself a Rowset object using the ATL templates that does
effectively the same thing: you give your rowset class a pointer to another
rowset which it copies the column definitions of. You could also have
this rowset initialise itself with the data you want populated by applying a
filter to the rowset beforehand and passing the chapter handle to the
initialisation routine (assuming the records you want _can_ be filtered
out and that you're using a source rowset that supports
filters).</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=643571609-04022003>Both
methods are relatively simple to do, but can be quite time consuming with
large data sets. Obviously in this case, applying filters in CCE is
going to be far more efficient than scanning rowsets on your own. Other
than this I honestly can't say which is 'best' as it depends on what your
intended use of the copied rowset actually is. In fact what is a better
solution than both of these is if you don't actually need a 'copy' of the
rowset and can simply get away with applying filters to the original and
keeping hold of the chapter handles for later use. I do this
frequently.</SPAN></FONT></DIV>
<P><FONT face=Arial size=2>Mark</FONT> <BR><FONT face=Arial
size=2>--------------------------------------------------------------</FONT>
<BR><FONT face=Arial size=2>Mark Dawson ([email protected])</FONT>
<BR><FONT face=Arial size=2>Software Project Leader</FONT> <BR><FONT
face=Arial size=2>SRH Systems Ltd.</FONT> <BR><FONT face=Arial
size=2>Lowesmoor Wharf, Worcester.</FONT> <BR><FONT face=Arial size=2>WR1 2RS.
UK</FONT> <BR><FONT face=Arial size=2>+44 (0)1905 613361</FONT> </P>
<BLOCKQUOTE>
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> Alan Gamboa
[mailto:[email protected]]<BR><B>Sent:</B> 03 February 2003
15:32<BR><B>To:</B> [email protected]<BR><B>Subject:</B>
[OLEDB_DEV] Rowsets<BR><BR></DIV></FONT>
<P><FONT size=2>I have a query:</FONT> </P>
<P> <FONT size=2>select f1,f2,f3
from t1 where f1 = 1</FONT> </P>
<P><FONT size=2>this query returns a rowset of 50 records.</FONT> </P>
<P><FONT size=2>I want create a new rowset that contains some of the records
in the above rowset, what is the best way to do this?</FONT> </P>
<P><FONT size=2>thanks.</FONT> </P>
<P><FONT size=2>Alan Gamboa</FONT> <BR><FONT size=2>CCG Systems, Inc.</FONT>
</P>You can read messages from the OLEDB_DEV archive, unsubscribe from
OLEDB_DEV, or subscribe to other DevelopMentor lists at
http://discuss.develop.com.
<BR>________________________________________________________________________<BR>This
email has been scanned for all viruses by the MessageLabs
SkyScan<BR>service. For more information on a proactive anti-virus service
working<BR>around the clock, around the globe, visit
http://www.messagelabs.com<BR>________________________________________________________________________<BR></BLOCKQUOTE><BR>________________________________________________________________________<BR>This
email has been scanned for all viruses by the MessageLabs SkyScan<BR>service.
For more information on a proactive anti-virus service working<BR>around the
clock, around the globe, visit
http://www.messagelabs.com<BR>________________________________________________________________________<BR>You
can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
</BLOCKQUOTE></BODY></HTML>
You can read messages from the OLEDB_DEV archive, unsubscribe from OLEDB_DEV,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.
------_=_NextPart_001_01C2CC63.B2DFB870--