BUG: sp_OAmethod is Unable to Retrieve Output Passed Through OLE Object Functions with 18 or More Parameters (265544)



The information in this article applies to:

  • Microsoft SQL Server 6.5
  • Microsoft SQL Server 7.0

This article was previously published under Q265544
BUG #: 57915 (SQLBUG_70)
BUG #: 19030 (SQLBUG_65)

SYMPTOMS

If you have an OLE object with a function that requires 18 or more parameters, the sp_OAmethod extended stored procedure is unable to retrieve the value passed to the parameter. For example, the following function of an OLE object has 18 parameters and @param18 is an output parameter. If you run this code:
EXEC @ret =  sp_OAMethod  @objTestOA1, 'Function18',@out1 Output,  @param1, @param2, @param3, @param4, @param5, @param6, @param7, @param8, @param9, @param10, @param11, @param12, @param13, @param14, @param15, @param16, @param17, @param18 output.  
Instead of retrieving the value expected by the function call, sp_OAmethod always returns null for @param18.

NOTE: This problem only occurs with output parameters. If you have 18 or more parameters that are all input parameters for a function, the problem does not occur.

WORKAROUND

To work around this problem:
  • Code OLE object functions to use 17 or fewer parameters.

    -or-

  • Use object properties to pass items that cannot be passed with 17 parameters.
The use of output parameters is not the only way to retrieve information from an OLE object. You can code an OLE object to have settable properties. Then, you can retrieve information through the properties by using the sp_OAProperty extended stored procedure.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.


Modification Type:MajorLast Reviewed:10/16/2003
Keywords:kbBug kbpending KB265544