We're getting the following error whenever we run our billing system:
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (recv())
[Microsoft][ODBC SQL Server Driver][TCP/IP Sockets]ConnectionRead (recv())
It is caused by calling the execute method of an ADOConnection object instantiated in Delphi 6. The code looks like this:
with ADOConnection do
Execute('Update Billing_AccountServices '+
'set BillingRun_ID = '+IntToStr(iBillingRun_ID)+
' where Account_ID = '+IntToStr(LastSubAccount_ID)+
' and ServiceID = '+IntToStr(FieldValues['ServiceID']));
This error occurs after several thousand transactions have been processed using the same ADOConnection. From what I can see, the function call times out even if I set the CommandTimeout property to 120 seconds. However, if there aren't many transactions processed (I can't say the exact figure), function call doesn't time out and the error doesn't occur. Everything seems to be fine.
The weird thing is that we get this error most of the time we run the billing system. However, once in a while (I'd say 1 in 30 runs), we can run the billing system and none of these errors occur. It runs fine even though we didn't change anything in the code, in SQL Server or in ODBC settings.
- database is SQL Server 2000 SP3
- MDAC 2.7 on both client machine and server
- running Delphi 6 application that uses ADO to connect and retrieve data from database
- OS is WinXP on client machine and Win2K on server
- connection is by ODBC using TCP/IP and IP address
Basically, I'd like to have someone explain to me what the problem is and either point me in the right direction or tell me how to fix it.
Thank you all for your responses.