-
I am currently using the .GetRows method of the ADODB recordset to populate arrays. I am wondering if there is a way to populate the array directly somehow, so I do not have to use an ADO recordset. The reason for this is performance related. If this is possible would eliminating the recordset make the app faster? I have read that the recordsets can be memory hogs.
Thanks.
-
do you load your recordset's data from a database?
-
Yes. I am loading it from SQL 7.0
-
as far as i know (which is not much), there is no decent way to retreive data from a database without using a recordset. if you need to return only a few values from your database, you could return values from a stored procedure, but for large amount of data (espacialy in n-tier apps) you will have to find different approaches to pass data between tiers.
- creating variant arrays via GetRows may seem somewhat easy, but be prepared to pay a performance penalty in a n-tier enviroment.
- GetString will at least reduce some overhead regarding network traffic.
- if you use ADO 2.5 or later, you could concider using XML to pass data between tiers + invest your time in the future.
- in many circumstancies property bags are a decent way to pass data between tiers.
- last but not least disconnected recordsets could be a decent option (as far as i read they should be more efficient then variant arrays still).
- in some cases UDTs together with LSet can efficiently be utilized to pass data (read Wrox Press: VB6 Business Objects).
good luck
Sascha