ADODB RecordCount, or OUTPUT parameter in stored procs: best practice
Posted on 2007-03-26
keywords: ADODB CursorType CursorLocation RecordCount Output Parameter Stored Procedure best practice
I need to get record counts on some recordsets that will be retrieved via ADODB command objects, using stored procedures. I'd like to know the wisest way to do this.
For a small (low traffic, few users) desktop client-server app using SQL Server 2005 through ODBC connection, in a small office LAN with a handful of workstations, is it faster/better to retrieve the ADO RecordCount by
A.) using an OUTPUT parameter in the stored proc that holds the COUNT
B.) use an appropriate CursorType, CursorLocation, and read the .RecordCount property from the recordset? (adOpenStatic and adUseServer?)
I'm sure there are times when both methods are wisest ("best practice"), but if I do not need to traverse the recordset more than once (forward), is there a performance penalty or something else that dictates which method to use?