Re: How to summarize recordset...Select Distinct alternative?
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Wed, 14 Nov 2007 14:41:52 -0500
MP wrote:
Is creating a Dictionary object more efficient than creating a
Recordset object?
Yes. It's got a smaller footprint. you don't need full cursor
functionality to store a set of paired values (Item, Count). You just
need a keyed structure to allow you to access the values quickly. A
Dictionary provides this. Look it up in online help - it's really easy
to use.
and disconnect it before processing it
Set oRsPcmkCountAll.ActiveConnection = Nothing
'close the connection at this point - it's no longer needed
-------------------
now that's something I didn't know.
So if you use adUseClient, then the recordset is copied into local
memory?
Yes. ADO provides a Cursor Library that provides the cursor
functionality provided by most databases. When using a client-side
cursor, ADO retrieves all the data requested by the sql statement using
an efficient firehose cursor and deposits it into a static cursor from
the Cursor Library.
all my database actions create / connect / execute etc are wrapped in
a class i made to "encapsulate" (read compensate for my poor memory
<g> ) all the connection string stuff etc...all of which was new to
me and therefore not easy to remember all the syntax etc.
so now I could add disconnecting the connection...if the operation is
read only that is....as in this example it happens to be....
It doesn't have to be readonly. A disconnected recordset can be
reconnected to the database simply by setting the ActiveConnection to an
open connection object. You can perform all the functions associated
with a disconnected recordset (including Update, AddNew and Delete) that
you can perform with a connected recordset. The only difference is that
changes are not done to the database data ... unless you open the
recordset using a LockType of adLockOptimisticBatch, which allows you to
use the UpdateBatch method after reconnecting the recordset to cause
your changes to be sent to the database.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- References:
- How to summarize recordset...Select Distinct alternative?
- From: MP
- Re: How to summarize recordset...Select Distinct alternative?
- From: Bob Barrows [MVP]
- Re: How to summarize recordset...Select Distinct alternative?
- From: MP
- Re: How to summarize recordset...Select Distinct alternative?
- From: Bob Barrows [MVP]
- Re: How to summarize recordset...Select Distinct alternative?
- From: MP
- Re: How to summarize recordset...Select Distinct alternative?
- From: Bob Barrows [MVP]
- Re: How to summarize recordset...Select Distinct alternative?
- From: Bob Barrows [MVP]
- Re: How to summarize recordset...Select Distinct alternative?
- From: MP
- Re: How to summarize recordset...Select Distinct alternative?
- From: Bob Barrows [MVP]
- Re: How to summarize recordset...Select Distinct alternative?
- From: MP
- How to summarize recordset...Select Distinct alternative?
- Prev by Date: Re: How to summarize recordset...Select Distinct alternative?
- Next by Date: Re: How to summarize recordset...Select Distinct alternative?
- Previous by thread: Re: How to summarize recordset...Select Distinct alternative?
- Next by thread: Re: How to summarize recordset...Select Distinct alternative?
- Index(es):
Relevant Pages
|
|