|
-
July 10th, 2001, 07:56 AM
#1
Bang Efficiency
Is the use of the bang when referencing a field name efficient?
strOldFirst = rstEmployees!fname
-
July 10th, 2001, 08:02 AM
#2
Re: Bang Efficiency
It is as efficient as
strOldFirst = rstEmployees("fname")
strOldFirst = rstEmployees.fields!fname
strOldFirst = rstEmployees.fields("fname")
strOldFirst = rstEmployees.fields("fname").value
cause eventually, when compiled, it all looks the same
however, using the index number instead of the name will be faster, but less flexible when the recordset changes (like fields swapping place and stuff)
strOldFirst = rstEmployees.Fields(0)
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
-
July 10th, 2001, 08:50 AM
#3
Re: Bang Efficiency
What does the bang actually do? Why use it?
-
July 10th, 2001, 08:55 AM
#4
Re: Bang Efficiency
rs.(0)
rs("Customer_Code")
rs.fields(0)
rs.fields("Customer_Code")
rs.fields.item(0)
rs.fields.item("Customer_Code")
In VBScript, the versions that use field indexes instead of names are faster and the extended syntax-rs.fields.
item(0)-is fastest. The reason: Although VBScript, like VB, supports default properties, VBScript doesn't
have to search manually for the default property of the object being referenced.
'undocumented feature
with rs
.collect(fld1)
.collect(fld2)
end with
works 30% faster then rs!Field
Iouri Boutchkine
[email protected]
-
July 10th, 2001, 08:58 AM
#5
Re: Bang Efficiency
don't know actually, I only know it can be used for reffering fields in a collection, don't even know if it can be used for all collections, or if it's only for recordsets
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
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
|