Microsoft KB Archive/921495

= Error message when you call a stored procedure to obtain output parameter data using the Host Integration Server (HIS) 2000 ODBC Driver for DB2 or HIS 2004 ODBC Driver for DB2:&quot;(0x80040E5D) [Microsoft][ODBC DB2 Driver] Invalid attribute/option identifier&quot; =

Article ID: 921495

Article Last Modified on 12/4/2007

-

APPLIES TO


 * Microsoft Host Integration Server 2000 Standard Edition
 * Microsoft Host Integration Server 2000 Service Pack 1
 * Microsoft Host Integration Server 2000 Standard Edition
 * Microsoft Host Integration Server 2004 Standard Edition

-





SYMPTOMS
When you try to use Microsoft Active Server Pages (ASP) or Microsoft ActiveX Data Objects (ADO) to obtain output parameter data from a stored procedure through the Microsoft Host Integration Server 2000 ODBC Driver for DB2 or the Microsoft Host Integration Server 2004 ODBC Driver for DB2, you may receive one of the following error messages:

Error message 1

Microsoft OLE DB Provider for ODBC Drivers (0x80040E5D) [Microsoft][ODBC DB2 Driver] Invalid attribute/option identifier.

Error message 2

(0x80040E21) [Microsoft][ODBC DB2 Driver] Invalid attribute/option identifier.



CAUSE
This problem occurs because the Microsoft OLE DB provider for ODBC tries to use named parameters. However, the Host Integration Server 2000 ODBC Driver for DB2 or the Host Integration Server 2004 ODBC Driver for DB2 does not support named parameters.



WORKAROUND
To work around this problem, use one of the following two methods if you can use the Host Integration Server 2000 OLE DB provider for DB2 or the Host Integration Server 2004 OLE DB provider for DB2:

Note There is no workaround if you use the Microsoft ODBC Driver for DB2.   Set the value of the CommandType property to adCmdText, and change the statement to &quot;CALL PROCEDURENAME(?,?)&quot;. You can use a question mark (?) to reference the parameters as many times as it is required. For example, you can use the following syntax to call a stored procedure in DB2 from class ADO. .CommandType = adCMDText .CommandText = &quot;Call ProcedureName (?,?)&quot;  Use the Execute method on a command object. For more information about this method, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/ms917532.aspx





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



MORE INFORMATION
The &quot;Integrating RPG and CL Programs by Using the Microsoft OLE DB Provider for DB2&quot; document includes sample code that helps illustrate how to use the DB2 stored procedure. The &quot;Sample Client Code&quot; section and the &quot;DB2 Stored Procedure&quot; section in the document may help you use the DB2 stored procedure. The document describes how to use DB2 stored procedures to call RPG (Report Program Generator) and CL (Control Language) programs that are running on an IBM iSeries or AS/400 system together with the Microsoft OLE DB provider for DB2. The document includes samples of RPG and CL server programs. The document also includes Microsoft Visual Basic 6.0, Microsoft Visual Basic .NET, and Microsoft Visual C# .NET client-side sample code to connect to those programs.

To obtain the &quot;Integrating RPG and CL Programs by Using the Microsoft OLE DB Provider for DB2&quot; document, visit the following Web site:

http://www.microsoft.com/downloads/details.aspx?FamilyID=145b7a37-4f44-4093-9c54-36fab9389ac0&DisplayLang=en

For more information about how to use the stored procedure, visit the following MSDN Web site:

http://msdn2.microsoft.com/en-us/library/ms131094.aspx

For more information about Host Integration Server, visit the following MSDN Web site:

http://msdn2.microsoft.com/en-us/library/aa286574.aspx

The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Keywords: kbtshoot kbprb KB921495

-

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

© Microsoft Corporation. All rights reserved.