We help IT Professionals succeed at work.

ADO Return Code

yassin092898
yassin092898 asked
on
Medium Priority
172 Views
Last Modified: 2009-07-29
I have stored procedure that return an error code if no resulting record sets are available. How can I capure the error code.

On Error GoTo HandleError
objCon.Open "DSN=xapidsn;UID=sa;PWD="
If objCon.State = adStateOpen Then
   rs.Open strSQL10, objCon

I want to check the error code here


Thanks
Comment
Watch Question

Senior DBA
CERTIFIED EXPERT
Commented:
If you want to check the return code, use a Command object to open the stored procedure.  Before executing the SP, add a Parameter to the Parameters collection with the adParamReturnValue property.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.