Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

SQLOLEDB Parametrized query may not report network errors


View products that this article applies to.

Symptoms

An application issues a parameterized query to SQL Server by using the SQLOLEDB provider. If the query exceeds a certain length and a network error causes the connection to be broken, no error is raised to the application.

↑ Back to the top


Cause

The provider buffers the text of the query and sends it as separate network packets to the server. If the query exceeds the length of the first network packet and the send returns a failure, the provider fails to propagate the error up to the caller.

↑ Back to the top


Resolution

Use one of the methods to resolve the problem:

  • Reduce the size of the query if possible.
  • Check the pcRowsAffected argument of��ICommand::Execute for the DB_COUNTUNAVAILABLE value. If the result is S_OK but pcRowsAffected is DB_COUNTUNAVAILABLE, it implies that the Execute command did not succeed. If you run into this scenario, you should reopen the connection and retry the failed command.




↑ Back to the top


More information

The length of the query that triggers the condition is not deterministic because it is dependent on the query text as well as the values of any parameters sent. It has been observed with a query with roughly 64 parameters but it could be seen with fewer parameters as well.

↑ Back to the top


Applies to:

↑ Back to the top

Keywords: KB2089037

↑ Back to the top

Article Info
Article ID : 2089037
Revision : 1
Created on : 5/19/2010
Published on : 5/19/2010
Exists online : False
Views : 474