Easysoft
ODBC Drivers for Oracle, SQL Server, Firebird, ISAM, InterBase, Sybase, MS Access & more.

Easysoft ODBC-InterBase Driver

Is there a way I can call SQLRowCount if I am using the ODBC driver via ADO?

Article : 00873
Last Reviewed : 19th July 2005
Revision : 1

Yes, the call is in ODBC32.dll (which calls ibodbc.dll), which is a C API.

To call it from Delphi, declare as follows:

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


From ADO, you would use (culled from http://www.devguru.com/Technologies/ado/quickref/command_execute.html):

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 is a row-returning query, the results are stored in a new Recordset object. If it is not a row-returning query, the provider will return a closed Recordset object.

There are three optional parameters.

The optional RecordsAffected parameter is a long value returned by the provider that is the number of records affected by an action query. (For a row-returning query, you will need to use the RecordCount property of the Recordset object to get a count of how many records are in the object.)

The optional Parameters parameter is used to change, update, or insert new parameter values into the Parameters Collection assigned to the Command object.

The optional Options parameter defines how the provider should evaluate the CommandText parameter. It is a long value that is the sum of one or more of the CommandTypeEnum or ExecuteOptionEnum constants. The default is adCmdUnspecified or -1.

Applies To

Knowledge Base Feedback

* Did this content help you?
Yes
No
Maybe
 
* Please select one option based on your first choice:
I'm very satisfied
I think it will help, but I haven't tried it yet
It is helpful, but I need more information
It is helpful, but hard to understand
Seemed relevant in search results, but didn't help me
The information is incorrect
The page contains one or more broken links
 
  Suggest new content or let us know how we can improve this content:

 
  (* Required Fields)   



© 1993 - 2008 Easysoft Limited. All rights reserved.