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
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
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
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