Microsoft KB Archive/907526

From BetaArchive Wiki

Article ID: 907526

Article Last Modified on 12/4/2007



APPLIES TO

  • Microsoft Host Integration Server 2004 Enterprise Edition
  • Microsoft Host Integration Server 2004 Standard Edition
  • Microsoft OLE DB Provider for DB2



SYMPTOMS

Consider the following scenario. You use the OLE DB Provider for DB2 that is included in Microsoft Host Integration Server 2004 to insert data into an IBM DB2 table. The IBM DB2 table contains an identity column. In this scenario, the DB_E_ERRORSOCCURRED error code may be returned to the calling application. Additionally, the DBSTATUS_E_BADSTATUS status code may be returned to the calling application.

This problem occurs when the status of the identity column is set to the DBSTATUS_S_IGNORE status code before the application tries to insert data into the table.

For example, the following SQL command creates an IBM DB2 table that contains an identity column. Therefore, this command creates an environment in which this problem may occur.

CREATE TABLE IBMDB2.TEST_TABLE ( 

    COLUMN1 INTEGER GENERATED ALWAYS AS IDENTITY ( START WITH 1, INCREMENT BY 1, NO CYCLE, MINVALUE 1, MAXVALUE 2147483647, NO CACHE ), 

    COLUMN2 INTEGER NOT NULL ) 

    IN USERSPACE1

CAUSE

The OLE DB Provider for DB2 that is included in Host Integration Server 2004 does not support the DBSTATUS_S_IGNORE status code when one of the following methods is invoked:

  • IRowsetChange::Insert
  • IRowsetChange::SetData

Because the DBSTATUS_S_IGNORE status code is not supported, the OLE DB Provider for DB2 returns the DBSTATUS_E_BADSTATUS status code and the DB_E_ERRORSOCCURRED error code.

RESOLUTION

Hotfix information

A supported hotfix is now available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

File information

The English version of this hotfix has the file attributes (or later file attributes) 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 item in Control Panel.

File name File version File size Date Time Platform Service pack (SP) requirement
Db2oledb.dll 6.0.1997.0 487,936 10-Nov-2005 21:49 x86 SP1
Db2oledb.h Not applicable 24,516 10-Nov-2005 21:54 Not applicable SP1
Ddmstr.dll 6.0.1997.0 44,032 10-Nov-2005 21:49 x86 SP1
Drdaresync.exe 6.0.1997.0 336,896 10-Nov-2005 21:49 x86 SP1
Microsoft.hostintegration.dataaccesslibrary.dll 6.0.1997.0 86,016 10-Nov-2005 21:49 x86 SP1
Microsoft.hostintegration.dataaccesstool.exe 6.0.1997.0 2,703,360 10-Nov-2005 21:49 x86 SP1
Microsoft.hostintegration.msdb2client.dll 6.0.1997.0 114,688 10-Nov-2005 21:49 x86 SP1
Mseidb2c.dll 6.0.1997.0 71,680 10-Nov-2005 21:48 x86 SP1
Mseidb2d.dll 6.0.1997.0 435,200 10-Nov-2005 21:49 x86 SP1
Mseidrda.dll 6.0.1997.0 694,272 10-Nov-2005 21:49 x86 SP1

Note Because of file dependencies, the most recent hotfix that contains these files may also contain additional files.


STATUS

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

MORE INFORMATION

After you apply the hotfix, the OLE DB Provider for DB2 correctly ignores columns that contain the DBSTATUS_S_IGNORE status code when the OLE DB Provider for DB2 invokes one of the following methods:

  • IRowsetChange::Insert
  • IRowsetChange::SetData

Steps to reproduce the problem

You can reproduce the problem by using the Rowset Viewer OLE DB sample application (RowsetViewer.exe). To do this, follow these steps:

  1. Create an IBM DB2 table that contains an identity column.

    Note To create this table, use the SQL command that is mentioned in the "Symptoms" section.
  2. Click Start, click Programs, click Microsoft Data Access SDK Version_Number, and then click Rowset Viewer. The Microsoft OLE DB RowsetViewer window appears.

    Note If Rowset Viewer is not installed on the system, download the Microsoft Data Access Components (MDAC) software development kit (SDK). For more information about the MDAC SDK, visit the following Microsoft Web site:
  3. In Windows Explorer, locate the Universal Data Link (UDL) file that contains the connection information for the IBM DB2 system.

    Notes
    • Use the Host Integration Server 2004 Data Access Tool to create the UDL file.
    • By default, UDL files are in the following location:

      C:\Documents and Settings\User_Name\My Documents\Host Integration Server Projects\Data Sources

  4. To connect to the IBM DB2 system, drag the UDL file from Windows Explorer to Rowset Viewer, and then click OK.
  5. Run the following SQL command:

    SELECT * FROM Table_Name

    Note The placeholder Table_Name represents the name of the table that you created in step 1.

  6. In the Objects window in Rowset Viewer, right-click Rowset (SELECT * FROM Table_Name), click IRowsetChange, and then click InsertRow.

    Note If the SELECT command that is mentioned in step 5 returns any data, you must click IRowset and then click ReleaseRows before you go to step 7.
  7. Right-click the status value for the identity column to change the identity column status, and then click DBSTATUS_S_IGNORE.
  8. Double-click the data value for a nonidentity column, and then type a value to insert into the table. For example, if the nonidentity column is defined as an INTEGER data type, type an integer.
  9. Click InsertRow to insert the new data into the table. If the hotfix has not been applied, Rowset Viewer displays several error dialog boxes that show codes DBSTATUS_E_BADSTATUS and DB_E_ERRORSOCCURRED.

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

REFERENCES

For more information about the DBSTATUS_S_IGNORE status code and about other status codes for the OLE DB Provider for DB2, visit the following Microsoft Developer Network (MSDN) Web site:

Keywords: kbbug kbfix kbqfe kbpubtypekc kbhotfixserver KB907526