BUG: Running a Stored Procedure by Using a Remote Procedure Call May Cause an Exception in the int_sendreturnparam Function (319126)



The information in this article applies to:

  • Microsoft SQL Server 7.0

This article was previously published under Q319126
BUG #: 102240 (SQLBUG_70)

SYMPTOMS

If you run a stored procedure by using a Remote Procedure Call (RPC) (for example through an ADO Command object), an Exception Access Violation (AV) may occur if all of the following conditions are met:
  • A Command object is defined with an input-output type of parameter.

  • The same Command object parameter is defined without a default value.

  • The stored procedure definition includes a default value definition for an output parameter.
You may see the following error message in the SQL Server error log:
Error: 0, Severity: 19, State: 0 execrpc: Process 9 generated an access violation. SQL Server is terminating this process.
The stack dump in the SQL Server error log may look similar to the following if you are using SQL Server 7.0 Service Pack 3:
Short Stack Dump
0x41075e49 Module(opends60+15e49) (int_sendreturnparam+755)
0x410698a5 Module(opends60+98a5) (sendReturnValues+5a)
0x41061a43 Module(opends60+1a43) (sendParams+2c)
0x410619f5 Module(opends60+19f5) (srv_completioncode+68)
				

WORKAROUND

To work around this behavior you can either:
  • Replace any lines of code similar to
    MyCommandObject.Parameters.Append MyCommandObject.CreateParameter("@parameter1", adInteger, adParamInputOutput)
    					
    with any of the following:
    • MyCommandObject.Parameters.Append MyCommandObject.CreateParameter("@parameter1", adInteger, adParamInput)
      							
      -or-
    • -or-
      Dim nParameter1 As Integer
      MyCommandObject.Parameters.Append MyCommandObject.CreateParameter("@parameter1", adInteger, adParamInputOutput, , nParameter1)
      							
      -or-
    • -or-
      MyCommandObject.Parameters.Append MyCommandObject.CreateParameter("@parameter1", adInteger, adParamInputOutput, , Null)
      							
    -or-

  • with any of the following: Upgrade to Microsoft SQL Server 2000.

STATUS

Microsoft has confirmed that this is a problem in SQL Server 7.0.

Modification Type:MajorLast Reviewed:12/13/2002
Keywords:kbbug KB319126 kbAudDeveloper