I wonder if the error does not come from
one or more of the following (i.e., DoCmd
getting confused by RecordCount or "other
stuff" that gets or does not get returned):
http://www.able-consulting.com/ADO_FAQ.htm
Q2) I keep on getting a "-1" for the my Recordset's RecordCount property. Why?
By default, ADO creates a server-side recordset with a CursorType of forward-only
(adOpenForwardOnly). A forward-only cursor does not support the RecordCount
property, even if you move to the last record in the recordset after you've opened
it.
Q25) Using the SQLOLEDB provider, whenever I call a stored procedure that uses a temp
table, I get the error message "3704 - The operation requested by the application is
not allowed if the object is closed." Why?
The SQL Server OLE DB provider (SQLOLEDB) has a new behavior designed to provide more
accurate information about what happened in the stored procedure.
Each SQL statement within a stored procedure returns a "result", either a count of
rows affected, or a resultset. You can walk through these result sets in ADO using
the NextRecordset method on the Recordset object.
If you don't want this more accurate information, then put the "SET NOCOUNT ON"
statement at the beginning of the stored procedure.
Q40) When calling a Stored Procedure, I'm getting null values for the output
parameter(s). Why?
When using a server-side (adUseServer) cursor location, ADO doesn't fill in the out
parameter(s) for a recordset until the returned recordset is closed.
If you need the value of an output parameter(s) before closing the recordset, then
use a client-side (adUseClient) cursor.