VSD Puts Spaces Around the Table Name and Causes an Error with DB2OLEDB (329853)



The information in this article applies to:

  • Microsoft Host Integration Server 2000

This article was previously published under Q329853

SYMPTOMS

NOTE: This article also applies to Microsoft Host Integration Server 2000 Service Pack 1 (SP1).

If you drag a database table from Microsoft Visual Studio .NET Server Explorer to a WinForm, and you use the Microsoft OLE DB Provider for DB2 (DB2OLEDB) that is included with Host Integration Server 2000, you may receive the following error message:
The wizard detected the following problems when configuring the Data Adapter for "MyTableName".

Details:

Generated Select Statement.

Error in Select clause: expression near ""
Error in From clause: near "".
Unable to parse query text.
This error occurs when you use the Microsoft OLE DB Provider for DB2 when the update that is described in the following Knowledge Base article is applied to Microsoft Visual Studio .NET:

325790 FIX: Providers Fail When Visual Studio Database Designer Wizard Puts Brackets Around the Table Name

If the Visual Studio .NET update is not applied, the error that is described in article Q325790 occurs.

CAUSE

The Visual Studio Database (VSD) Designer Wizard creates a SELECT statement for OleDbDataAdapter that has brackets around the table name if the update that is described in Q325790 is not applied. The Microsoft OLE DB Provider for DB2 does not support brackets around the table or schema name, so the statement fails with the error that is described in Q325790.

If the update in Q325790 is applied to Visual Studio .NET, the VSD Designer Wizard works with the Microsoft OLE DB Provider for DB2 and puts spaces around the table name in the generated SELECT statement. This results in the error message that is described in the "Symptoms" section.

RESOLUTION

Service pack information

To resolve this problem, obtain the latest service pack for Microsoft Host Integration Server 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

328152 How to obtain the latest service pack for Host Integration Server 2000

Hotfix information

The English version of this fix has the file attributes (or later) 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 tool in Control Panel.
   Date         Time   Version     Size     File name
   --------------------------------------------------
   21-Oct-2002  19:31  5.0.0.900   667,920  Db2oledb.dll
				

NOTE: Because of file dependencies, the most recent fix that contains the preceding 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.

This problem was corrected in Microsoft Host Integration Server 2000 Service Pack 2.

MORE INFORMATION

The update that is described in this article adds support for DBLITERAL_QUOTE_PREFIX and DBLITERAL_QUOTE_SUFFIX to the Microsoft OLE DB Provider for DB2. DBLITERAL_QUOTE_PREFIX and DBLITERAL_QUOTE_SUFFIX are defined to specify " (double quotation marks) as the character put around table names in the VSD Designer Wizard-generated SELECT statements.

Modification Type:MinorLast Reviewed:9/27/2005
Keywords:kbHotfixServer kbQFE kbQFE kbbug kbfix KB329853 kbAudDeveloper