Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you count records with a parameter stored procedure?

Status
Not open for further replies.

Beren1h

Technical User
Jul 19, 2001
104
US
I'm trying to return the number of records in a recordset that is from a stored procedure (an Access Query) that is passed parameters.

I understand that the RecordCount method doesn't work in this situation.

Does anyone have a solution?
 
There's an optional numAffected parameter that you can pass in with the .execute method... that should return to you the number of retrieved records.
penny1.gif
penny1.gif
 
Yeah, I think I know what you mean, but doesn't that return the number of records affected by the stored procedure?

I'm just trying to retreive a recordset (not modify it) so this will just return '0'. At least that is what I have been getting (I think it makes sense)....?
 
Well, it can return many things, depending on what your sproc does. If all it's doing is running a SELECT statement, then I **think** it would return the number affected by that statement.

I know this to be the case on updates and deletes, but I don't use sprocs to return data, so I can't say for sure.

Maybe someone out there who does use sprocs for this purpose could shed some more light on the subject.
penny1.gif
penny1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top