Skip to content

Latest commit

 

History

History
47 lines (40 loc) · 3.05 KB

File metadata and controls

47 lines (40 loc) · 3.05 KB
title Count Property (ADO) | Microsoft Docs
ms.prod sql
ms.prod_service connectivity
ms.technology connectivity
ms.custom
ms.date 01/19/2017
ms.reviewer
ms.topic conceptual
apitype COM
f1_keywords
_Collection::Count
helpviewer_keywords
Count property [ADO]
ms.assetid da9ccd1f-d402-41a2-940c-45556fc5340d
author MightyPen
ms.author genemi

Count Property (ADO)

Indicates the number of objects in a collection.

Return Value

Returns a Long value.

Remarks

Use the Count property to determine how many objects are in a given collection.

Because numbering for members of a collection begins with zero, you should always code loops starting with the zero member and ending with the value of the Count property minus 1. If you are using Microsoft Visual Basic and want to loop through the members of a collection without checking the Count property, use the For Each...Next command.

If the Count property is zero, there are no objects in the collection.

Applies To

Axes Collection (ADO MD) Columns Collection (ADOX) CubeDefs Collection (ADO MD)
Dimensions Collection (ADO MD) Errors Collection (ADO) Fields Collection (ADO)
Groups Collection (ADOX) Hierarchies Collection (ADO MD) Indexes Collection (ADOX)
Keys Collection (ADOX) Levels Collection (ADO MD) Members Collection (ADO MD)
Parameters Collection (ADO) Positions Collection (ADO MD) Procedures Collection (ADOX)
Properties Collection (ADO) Tables Collection (ADOX) Users Collection (ADOX)
Views Collection (ADOX)

See Also

Count Property Example (VB)
Count Property Example (VC++)
Refresh Method (ADO)