Microsoft KB Archive/330096

= Calling Stored Procedure From ADO.NET Results in SQLCODE: -188 =

Article ID: 330096

Article Last Modified on 9/27/2005

-

APPLIES TO


 * Microsoft Host Integration Server 2000 Standard Edition

-



This article was previously published under Q330096



SYMPTOMS
Note: This article also applies to Microsoft Host Integration Server 2000 Service Pack 1 (SP1).

Calling a Stored Procedure from ADO.NET using the Microsoft OLE DB Provider for DB2 results in the following error:

A SQL error has occurred. Please consult the documentation for your specific DB2 version for a description of the associated Native Error and SQL State. SQLSTATE: 22503, SQLCODE: -188



CAUSE
The OLE DB Provider for DB2 does not correctly parse the command used to call a Stored Procedure that is received from ADO.NET.



Service pack information
To resolve this problem, obtain the latest service pack for Microsoft Host Integration Server 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

328152 How to obtain the latest service pack for Host Integration Server 2000

Hotfix information
The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

  Date         Time   Version      Size    File name --  17-Oct-2002  17:58  5.0.0.900   880,912  Mseidb2d.dll 17-Oct-2002 17:58  5.0.0.900   262,416  Mseidrda.dll

NOTE: Because of file dependencies, the most recent fix that contains the preceding files may also contain additional files.



WORKAROUND
The problem does not occur if the call to the Stored Procedure is passed as command text. The following C# code excerpt can be used as an example: OleDbCommand myCommand = new OleDbCommand(&quot;CALL (?)&quot;, myConnection); myCommand.CommandType = CommandType.Text;



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

This problem was corrected in Microsoft Host Integration Server 2000 Service Pack 2.



MORE INFORMATION
ADO.NET sends a command in the following format to the OLE DB Provider when calling a Stored Procedure: EXEC ? Previous versions of ADO send the same command in the following format when calling a Stored Procedure: EXEC The SQL parser in the Microsoft OLE DB Provider for DB2 had to be updated to correctly parse the ? included in the ADO.NET format of the command.

Keywords: kbbug kbfix kbqfe kbhotfixserver KB330096

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.