How do I call SQLRowCount from Delphi or ActiveX Data Objects (ADO)?

To call SQLRowCount from Delphi:

function SQLRowCount(hstmt:LongInt;var RowCount:LongInt):SmallInt;stdcall;external 'ODBC32.DLL';

To call SQLRowCount from ADO:

METHOD: Command::Execute
Syntax for non-row-returning:

commandobject.Execute RecordsAffected, Parameters, Options
	      
Syntax for row-returning:
	      
Set recordsetobject = commandobject.Execute (RecordsAffected, Parameters, Options)

The Execute method returns a reference to a Recordset object. You use this method to execute the query, SQL statement, or stored procedure contained in the CommandText property of the Command object. If it's a row-returning query, the results are stored in a new Recordset object. If it's not a row-returning query, the provider returns a closed Recordset object.

There are three optional parameters.