Microsoft KB Archive/924599

From BetaArchive Wiki

Article ID: 924599

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 run an SQL statement by using Microsoft OLE DB Provider for DB2. The SQL statement passes a Microsoft SQL Server datetime parameter to an IBM DB2 database column. The IBM DB2 database column uses the IBM DB2 DATE data type. In this scenario, you may receive the following error message:

SQLSTATE: 22007, SQLCODE: -181

For example, the following SQL statement passes a SQL Server datetime parameter to an IBM DB2 database column.

declare @var1 datetime
set @var1 = '2006-09-27 00:00:00.000'
SELECT COL1, COL2, COL3
FROM IBMDB2.TESTDATA.USER1.TABLE1
WHERE COL2 = @var1

In this example, this problem occurs if the COL2 column uses the IBM DB2 DATE data type.

CAUSE

At runtime, OLE DB Provider for DB2 does not know the correct IBM DB2 data type for the IBM DB2 database column to which the SQL Server datetime parameter is passed. Therefore, OLE DB Provider for DB2 includes the date information and the time information in the value that OLE DB Provider for DB2 passes to the IBM DB2 database. The time information is not valid for the IBM DB2 DATE data type. Therefore, you receive the error message that is mentioned in the "Symptoms" section.

RESOLUTION

Microsoft Host Integration Server 2004

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 SP requirement
Db2oledb.dll 6.0.2048.0 488,960 03-Nov-2006 17:31 x86 SP1
Db2oledb.h Not Applicable 24,579 03-Nov-2006 17:36 Not Applicable SP1
Ddmstr.dll 6.0.2048.0 44,032 03-Nov-2006 17:31 x86 SP1
Drdaresync.exe 6.0.2048.0 337,408 03-Nov-2006 17:32 x86 SP1
Microsoft.hostintegration.dataaccesslibrary.dll 6.0.2048.0 86,016 03-Nov-2006 17:31 x86 SP1
Microsoft.hostintegration.dataaccesstool.exe 6.0.2048.0 2,703,360 03-Nov-2006 17:32 x86 SP1
Microsoft.hostintegration.msdb2client.dll 6.0.2048.0 114,688 03-Nov-2006 17:31 x86 SP1
Mseidb2c.dll 6.0.2048.0 71,680 03-Nov-2006 17:31 x86 SP1
Mseidb2d.dll 6.0.2048.0 435,200 03-Nov-2006 17:31 x86 SP1
Mseidrda.dll 6.0.2048.0 695,808 03-Nov-2006 17:32 x86 SP1

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

Microsoft OLE DB Provider for DB2 version 1.0

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.

32-bit (x86) version
File name File version File size Date Time Platform SP requirement
Db2oledb.dll 6.0.2048.0 488,960 03-Nov-2006 17:31 x86 SP1
Db2oledb.h Not Applicable 24,579 03-Nov-2006 17:36 Not Applicable SP1
Ddmstr.dll 6.0.2048.0 44,032 03-Nov-2006 17:31 x86 SP1
Drdaresync.exe 6.0.2048.0 337,408 03-Nov-2006 17:32 x86 SP1
Microsoft.hostintegration.dataaccesslibrary.dll 6.0.2048.0 86,016 03-Nov-2006 17:31 x86 SP1
Microsoft.hostintegration.dataaccesstool.exe 6.0.2048.0 2,703,360 03-Nov-2006 17:32 x86 SP1
Microsoft.hostintegration.msdb2client.dll 6.0.2048.0 114,688 03-Nov-2006 17:31 x86 SP1
Mseidb2c.dll 6.0.2048.0 71,680 03-Nov-2006 17:31 x86 SP1
Mseidb2d.dll 6.0.2048.0 435,200 03-Nov-2006 17:31 x86 SP1
Mseidrda.dll 6.0.2048.0 695,808 03-Nov-2006 17:32 x86 SP1
64-bit (x64) version
File name File version File size Date Time Platform Service branch
Db2oledb.dll 7.0.2535.0 758,544 07-Nov-2006 12:34 x64 Not Applicable
Microsoft.hostintegration.dataaccesslibrary.dll 7.0.2535.0 2,550,616 07-Nov-2006 12:34 x64 Not Applicable
Microsoft.hostintegration.dataaccesstool.exe 7.0.2535.0 613,200 07-Nov-2006 12:34 x64 Not Applicable
Mseidrda.dll 7.0.2535.0 1,355,536 07-Nov-2006 12:34 x64 Not Applicable
Snanls.dll 7.0.2535.0 128,776 07-Nov-2006 12:34 x64 Not Applicable
Db2oledb.dll 7.0.2535.0 516,880 07-Nov-2006 12:34 x86 SYSWOW
Mseidrda.dll 7.0.2535.0 781,072 07-Nov-2006 12:34 x86 SYSWOW
Snanls.dll 7.0.2535.0 105,224 07-Nov-2006 12:34 x86 SYSWOW

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

This hotfix adds support for a new connection string property. By using the new connection string property, you can pass a SQL Server datetime parameter to an IBM DB2 database as the IBM DB2 DATE data type. OLE DB Provider for DB2 deletes the time information in the value of the SQL Server datetime parameter. Therefore, OLE DB Provider for DB2 passes only the date information to the IBM DB2 database.

The new connection string property has the following definition:

DateTime As Date=Value


In this connection string property, you can define Value as TRUE or as FALSE. If you add the DateTime As Date=TRUE statement to the connection string, OLE DB Provider for DB2 converts the SQL Server datetime parameter to the IBM DB2 DATE data type. Then, OLE DB Provider for DB2 passes the value to the IBM DB2 database.

If you add the DateTime As Date=FALSE statement to the connection string, OLE DB Provider for DB2 passes the SQL Server datetime parameter to the IBM DB2 database as you specify in the SQL statement. In this case, OLE DB Provider for DB2 passes the date information and the time information to the IBM DB2 database.

Note This behavior is the default behavior if you do not add the DateTime As Date property to the connection string.

The following connection string example shows how to use the DateTime As Date property.

; Everything after this line is an OLE DB initialization string.
Provider=DB2OLEDB;Password=<Password>;Persist Security Info=True;User ID=<Username>;Initial Catalog=S105FRDM;Defer Prepare=False;Derive Parameters=False;Network Transport Library=TCP;Host CCSID=37;PC Code Page=1252;Network Address=<Address>;Network Port=446;Package Collection=DB2USER;Default Schema=DB2USER;Default Qualifier=DB2USER;DBMS Platform=DB2/AS400;Process Binary as Character=False;Connection Pooling=True;Units of Work=RUW;DateTime As Date=TRUE

Important After you apply this hotfix and add the DateTime As Date=TRUE statement to the connection string, you may receive the following error message:

SQLSTATE: 22007, SQLCODE: -180

This problem occurs if the IBM DB2 database column uses the IBM DB2 TIMESTAMP data type. This problem occurs because the IBM DB2 database expects to receive the date information and the time information when a query is passed to an IBM DB2 database column that uses the IBM DB2 TIMESTAMP data type. The DateTime As Date=TRUE statement causes OLE DB Provider for DB2 to delete the time information in the value of the SQL Server datetime parameter. Therefore, the data is not valid when the query is passed to the IBM DB2 database column that uses the IBM DB2 TIMESTAMP data type.

If you must query an IBM DB2 table that uses the IBM DB2 DATE data type and the IBM DB2 TIMESTAMP data type, you may have to use multiple connection strings that are configured to use the correct properties. Then, you can successfully query the various IBM DB2 data types.

For more information, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates


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.

Keywords: kbbug kbfix kbqfe kbpubtypekc kbhotfixserver kbhis2004 kbdb2oledb KB924599