Re: WSAECONNREFUSED on a TCP socket breaks an open ADO connection.



I expect that the operation in question is damaging (crashing) the pooled
connection--the link between the server and your client system. This might
not remove it from the pool so when you reopen the connection, you might get
the same (bad) connection. To test this theory, the next time you get this
exception, change the connection string before you try to reopen the
connection. If this works, it means one (or more) connections in the pool
are damaged. At this point you can stop the application entirely to flush
the pool, continue to use a different connection string (which will orphan
the contents of the pool--all its connections will remain open for 4-8
minutes unless they had been marked as closed), or wait until ADO 2.0 which
offers more options to flush the pool.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Ricardo Vazquez" <rvazquez@xxxxxxxxx> wrote in message
news:%23ln94GgYFHA.2768@xxxxxxxxxxxxxxxxxxxxxxx
> In the same program I have an open ADO database connection to SQL Server,
> and a TCP socket.
> When the socket tries to connect to a service that is inactive, the
> connect
> statement returns WSAECONNREFUSED (10061) --> that's Ok.
> BUT when I try to write this error on the database, ADO throws this error:
> 0x80004005 [DBNETLIB][ConnectionWrite (send()).] General network error.
>
> After this has happened:
> - I can't write to the database any more: I get 0x80004005 Connection
> Error.
> - If I try to destroy the database object, create it again and open the
> database again I get this error: 0x80004005 [DBNETLIB][ConnectionOpen
> (Connect()).] SQL Server does not exists or access has been denied. But,
> obviously the database is still there and I can reach it throught any
> other
> program or restarting mine!
>
> Does anyone know what can be happening?
> How can I prevent or avoid this unsolicited shut down of the database
> connection?
> In case that this is not possible, is there any way to successfully
> restart
> my connection to the database?
>
> Thank you very much in advanced,
>
> Ricardo Vázquez.
> Madrid, Spain.
>
>


.



Relevant Pages

  • Complicated Connection Problems bewteen ADP and SQL Server
    ... This database ... expertise for getting the user workstations talking to the SQL Server. ... connection would fail and the adp wouldn't be able to talk to the server. ... might be in my ADO connection string. ...
    (microsoft.public.access.adp.sqlserver)
  • Complicated Connection Problem between ADP and SQL Server
    ... This database ... expertise for getting the user workstations talking to the SQL Server. ... connection would fail and the adp wouldn't be able to talk to the server. ... might be in my ADO connection string. ...
    (microsoft.public.sqlserver.connect)
  • Re: Random database connectivity failure
    ... We can’t find any problems with the pooling, that it uses to many resources. ... pointing to its not a pool problem. ... The server is only used for this web-application, ... white paper on handling the connection pool on my website. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ADO Connection Timeout
    ... so what happens when a connection failure forces one station to revert ... to a local database? ... Further, you *will* have contention issues, Jet does not support record ... to the central server, but you are willing to live with periods where it ...
    (microsoft.public.data.ado)
  • Re: Problem with VPN setup
    ... I used unassigned addresses to create a static pool. ... if I am using RRAS for VPN it would not be many anyway. ... You can see the connection under "Remote Access ... create a VPN server. ...
    (microsoft.public.windows.server.general)