CHAPTER 8 Categories Collection

ProgID: ACBStore.cCategories

Description

The Categories collection provides access to the subcategories of the active (loaded) category.

 

Category_ID

Read Only. This Long value specifies the active (loaded) category. The subcategories in the collection are children of this category.

 

Count

Counts all subcategories in the active category.

GetRS

Returns an ADO recordset with the raw data for all subcategories in the collection.

Load

Initializes the collection for the active category.

Move

Changes the order of a subcategory within the collection.

Reset

Resets the collection and all contents, freeing any allocated resources.

SortByName

Sorts the subcategories within the collection by name.

Count Method

Counts all subcategories in the active category.

Syntax

intCount = colCategories.Count(objToken, [blnRecurse], [intCategoryID])

Return Value

Returns the number of Categories found in the specified category.

Parameters

objToken [in] A reference to a loaded Token object.

blnRecurse [in] Optional. A Boolean flag that specifies whether or not to include Categories within subcategories in the count. Default is false.

intCategoryID [in] Optional. A Long value that specifies the Category ID to count subcategories for. Defaults to the active category.

GetRS Method

Returns an ADO recordset with the raw data for all subcategories in the collection.

Syntax

Set rsCategories = colCategories.GetRS

Return Value

Returns a reference to an ADODB.Recordset that contains all Categories in the active category.

Load Method

Initializes the collection for the active category.

Syntax

Boolean = colCategories.Load(objToken, intCategoryID)

Return Value

Returns a boolean value indicating success (true) or failure (false).

Parameters

objToken [in] A reference to a loaded Token object.

intCategoryID [in] A Long value that specifies the Category for which to load the collection.

Move Method

Changes the order of a subcategory within the collection.

Syntax

Boolean = colCategories.Move(intCategoryID, intMoveStep)

Return Value

Returns a Boolean value indicating success (true) or failure (false).

Parameters

intCategoryID [in] A Long value that specifies the Category to move.

intMoveStep [in] An Integer value that indicates how many places the Category should move. Use negative numbers to move up in the list, positive numbers to move down.

Reset Method

Resets the collection and all contents, freeing any allocated resources.

Syntax

colCategories.Reset

Notes

Reset should always be called before setting the object to nothing. This will force all allocated memory to be freed.

SortByName Method

Sorts the subcategories within the collection by name.

Syntax

Boolean = colCategories.SortByName([intdirection])

Return Value

Returns a Boolean value indicating success (true) or failure (false).

Parameters

intDirection [in] Optional. An Integer flag that indicates the direction of the sort. Valid values are 0 (ascending) and 1 (descending). Default is 0.

Go to Main Go to Previous Go to Next