|
-
December 29th, 1999, 07:30 AM
#1
Recordset Class - memory usage and speed
Hi,
I'm doubting to create a general recordset class which automatically sets some properties (so that I don't have to set the active connection, cursor type, etc.).
Now I'm wondering... what's the most efficient way according to speed and memory:
use the ADODB.Recordset and forget the class (hehe that's the easiest :-)
or, create a property which wants a fieldname as argument, and get that field from the recordset and return it as Variant,
or, return a Recordset so I can use it in the program like ClassName.PropertyName!MyField
I'm especially intrested in the last 2 options :-)
Which one is the cheapest according to memory (less memory usuage) and is the fastest? Looking up the field (PropName = rst.Fields(psFieldName) ) or returning the recordset?
Tnx! :-)
Crazy D @ Work :-)
-
December 29th, 1999, 08:05 AM
#2
Re: Recordset Class - memory usage and speed
Fast methods to get value
variable = rs.get_Collect(1).Value
variable = rs(1)
variable = rs.Field(1)
[ufo]
-
December 29th, 1999, 01:55 PM
#3
Re: Recordset Class - memory usage and speed
I don't know about memory usage but as for speed I tried both methods you describe and went with the Recorset!Field.
As I'm sure you know, the class method is structurally better but if you need fast data access the easy way (Recorset!Field) is faster in this case.
Francis Gingras
-
December 30th, 1999, 01:50 AM
#4
Re: Recordset Class - memory usage and speed
Kudos to fgingras!!
I agree, it is certainly faster to use
rst!Field, especially if you have to do it in a loop or something.
Have a great Millenium!
____________________________________
The VB Bugs in my Life...
-
December 30th, 1999, 03:01 AM
#5
Re: Recordset Class - memory usage and speed
Hi,
Recordset!Field may be some faster, but using a class is easier (at least in my case) and for most of the tables I need to access speed doesn't matter, so I'll write the class, and in the few cases speed is really important, I'll use a recordset :-)
Tnx!
Crazy D @ Work :-)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|