SQLite3 COM ColectionsBaseIndex property
CollectionsBaseIndex read/write property 

Specifies the base index of the collections passed as 2-nd argument to CExecute.


object.CollectionsBaseIndex = 0
variable = object.CollectionsBaseIndex 


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. 

For example:

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.

Applies to: SQLite3 COM object

See also: CExecute

Supported on:

Windows 95/NT and later
Windows CE 3.0 and later
Pocket PC/Windows Mobile 2003 and later
Windows CE.NET 4 and later


newObjects Copyright 2001-2006 newObjects [ ]