Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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:"(0x80040E5D) [Microsoft][ODBC DB2 Driver] Invalid attribute/option identifier"


View products that this article applies to.

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.

↑ Back to the top


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.

↑ Back to the top


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 "CALL PROCEDURENAME(?,?)". 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.
<Command Name>.CommandType = adCMDText
<Command Name>.CommandText = "Call ProcedureName (?,?)"
Use the Execute method on a command object. For more information about this method, visit the following Microsoft Developer Network (MSDN) Web site:

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


More information

The "Integrating RPG and CL Programs by Using the Microsoft OLE DB Provider for DB2" document includes sample code that helps illustrate how to use the DB2 stored procedure. The "Sample Client Code" section and the "DB2 Stored Procedure" 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 "Integrating RPG and CL Programs by Using the Microsoft OLE DB Provider for DB2" document, visit the following Web site:For more information about how to use the stored procedure, visit the following MSDN Web site: For more information about Host Integration Server, visit the following MSDN Web site: 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.

↑ Back to the top


Keywords: KB921495, kbprb, kbtshoot

↑ Back to the top

Article Info
Article ID : 921495
Revision : 5
Created on : 12/4/2007
Published on : 12/4/2007
Exists online : False
Views : 409