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" (921495)



The information in this article applies to:

  • Microsoft Host Integration Server 2000
  • Microsoft Host Integration Server 2000 SP1
  • Microsoft Host Integration Server 2000 SP2
  • Microsoft Host Integration Server 2004

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 "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:

STATUS

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

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.

Modification Type:MajorLast Reviewed:8/8/2006
Keywords:kbtshoot kbprb KB921495 kbAudDeveloper