Microsoft Knowledge Base Email Alertz

(262462) - When all of the following conditions are met, unexpected error messages may occur: The OLE DB Provider for Microsoft SQL Server (Sqloledb.dll) is used. Two or more parameters of different datatypes are used. The statement is prepared. The statement...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 262462 - Last Review: March 14, 2006 - Revision: 3.1

FIX: Conversion Errors Occur in Prepared Statements That Use UNIONs

This article was previously published under Q262462
BUG #: 57554 (SQLBUG_70)

SYMPTOMS

When all of the following conditions are met, unexpected error messages may occur:
  • The OLE DB Provider for Microsoft SQL Server (Sqloledb.dll) is used.
  • Two or more parameters of different datatypes are used.
  • The statement is prepared.
  • The statement contains one or more UNION operators
Depending on the exact circumstances the error messages vary widely but may look similar to the following:
SQL error 241: Syntax error converting datetime from character string.

WORKAROUND

You can use either of the two following workarounds to avoid this problem:
  • Set the Prepared property of the Microsoft ActiveX Data Object (ADO) Command object to false.

  • Use the OLE DB Provider for ODBC Drivers and the ODBC Driver for Microsoft SQL Server.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
274799  (http://kbalertz.com/Feedback.aspx?kbNumber=274799/ ) INF: How to Obtain Service Pack 3 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.

APPLIES TO
  • Microsoft SQL Server 7.0 Standard Edition
  • Microsoft OLE DB Provider for SQL Server 7.01
Keywords: 
kbbug kbfix kbqfe KB262462
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate