<ADODB_Recordset>.RecordCount

<< Click to Display Table of Contents >>

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

<ADODB_Recordset>.RecordCount

 

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.

 

NOTE

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.

Also check ADODB_Connection.CursorLocation property: changing to %adUseClient can solve the problem.

 

See also

 

Examples