Specifies the base index of the collections passed as 2-nd argument
By default CExecute assumes
1-based indices. Most general purpose collection objects (often
called dictionary objects) are 1-based - good examples are: VarDictionary
(from AXPack1), Scripting Dictionary (from MS Active Scripting
run-times). Still, there is no standard about that and different
applications or components may expose collections that are 0-based
and sometimes (this is very rare) based on another number. Examples
of 0-based collections are ADO's Recordset, the Arguments collection
in Windows Scripting Host, the collections in DHTML and so on. Thus
if you want to pass such a collection to CExecute you may want to
set this property to 0 first in order to enable the method to
resolve un-named parameters in the query.
Generally CExecute is intended for use with named parameters,
thus the collection indices wont be a problem if no un-named
parameters are used and we strongly recommend this practice.
Set result = db.Execute("SELECT * FROM MyTable Where
Field1=$Param1 AND Field2 LIKE $Param2, somecollection)
will produce the same results regardless of the value of this
property, but if an unnamed parameter is used somewhere:
Set result = db.Execute("SELECT * FROM MyTable Where Field1=? AND Field2 LIKE $Param2, somecollection)
the results will differ depending on the base index used by the
particular collection object. For instance if somecollection
above is an ADO Recordset and CollectionsBaseIndex is set to 1 the
second field from the ADO Recordset will be substituted for the ?
parameter. On the other hand if the CollectionsBaseIndex is set to 0
the first field from the recordset will be substituted.