Navigation:  ThinBASIC Modules > ADODB > ADODB Module Classes > ADODB_Recordset > ADODB_Recordset Properties >

<ADODB_Recordset>.RecordCount

Previous pageReturn to chapter overviewNext page

 

Description

 
Returns a long value that indicates the number of records in a ADODB_Recordset object.

 

Syntax

 

n = <ADODB_Recordset>.RecordCount

 

Returns

 

Number

 

Parameters

 

Name

Type

Optional

Meaning





 

 

Remarks

 

This property will return:

-1 for a forward-only cursor
the actual count for a static or keyset cursor
-1 or the actual count for a dynamic cursor.

 

Restrictions

 

The ADODB_Recordset object must be open when calling this property. If this property is not supported it will return -1.

 

If the ADODB_Recordset object supports AbsolutePosition and AbsolutePage properties or bookmarks, this property will return the exact number of records in the ADODB_Recordset.

 

If property will return -1, and SQL syntax is ok and ADODB_Recordset.State is %adStateOpen also check ADODB_Recordset.CursorLocation property.

Default value is %adUseServer. Changing to %adUseClient can solve the problem.

 

See also

 

Examples