Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: VB6,VBS
Expertise: Intermediate
Jul 17, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

The hidden Collect method of the Recordset object

The ADO Recorset object exposes a hidden, undocumented member: the Collect property. This property is functionally similar to the Field's Value property, but it's faster because it doesn't need a reference (explicit or implicit) to the Field object. You can use this property by passing a numeric index or a field's name, as in:

Dim rs As New ADODB.Recordset
rs.Open "authors", "DSN=pubs"
' reference by field's name
firstName = rs.Collect("au_fname")
' reference by field's index
rs.Collect(2) = "John Doe"
Under ADO 2.5, the Collect property appears to be about 30% faster than the standard way to refer to a field's value.
Francesco Balena
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date