VB6 – ConnectionRead (recv()) error | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

VB6 – ConnectionRead (recv()) error

Hi<br /><br />I have developed a VB6 program which uses a SQLEXPRESS 2005 at its data source.<br />I currently connect to the database at application load and never disconnects, everytime i need the ADODB.connection i call a function called cnxn<br /><br />Public Function cnxn() As ADODB.Connection<br /> If aCnxn.state &lt;&gt; 1 Then<br /> If Not aCnxn.state = 0 Then aCnxn.Close<br /> aCnxn.Open "driver={SQL Server};server=127.0.0.1SQLEXPRESS;Network Library=DBMSSOCN;database=db1;uid=login<img src=’/community/emoticons/emotion-4.gif’ alt=’;p’ />wd=pass;"<br /> End If<br /> Set cnxn = aCnxn<br />End Function<br /><br />However sometimes my program catches the error<br />Error number: -2147467259<br />[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (recv()).<br /><br />It happens in different places of the application however it seems always to be connected to a Query using the above connection.<br /><br />Why does this happen ?<br />Shouldnt the above code tell me if there is a connection error and then reconnect to the database ? <br />
Check what are enabled protocol using Surface Area configuration tool on this instance.
Also check the connection timeout property (default value). Satya SKJ
Microsoft SQL Server MVP
Contributing Editor & Forums Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing.
Well i believe i have the Protocol Enabled because else i wouldnt be able to connect at all, would i ???
I have no problem connecting at all, and well i have around 60 different customers connecting to 60 different SQLServer Express Databases, however once they are connected and they start using the program, at some point they sometimes get one of these errors
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionRead (recv()).
Iam also periodically getting this error
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send()).
]]>