SQL Server Performance

VB6 - ConnectionRead (recv()) error

Discussion in 'SQL Server 2005 General Developer Questions' started by mSchmidt, Dec 17, 2006.

  1. mSchmidt New Member

    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 />
  2. satya Moderator

    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.
  3. mSchmidt New Member

    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()).

Share This Page