WSAECONNREFUSED on a TCP socket breaks an open ADO connection.



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

  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... Create a Connection object and pass in a ConnectionString to ... manage the database table you reference. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: (Newbie)Application Roles
    ... level: the database itself. ... SQL Server accommodates these needs through the use of application ... the user's connection through a specific application. ... the connection permanently loses all permissions applied to ...
    (microsoft.public.sqlserver.security)
  • Re: Help! Set up Windows Group to access application
    ... The connection string for a trusted connection is: ... --add login as database user ... SQL Server MVP ... If you have troubles with finding your ways in Crystal Reports, ...
    (microsoft.public.sqlserver.security)
  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Visual Studio but not to VS 2003. ... Create a Connection object and pass in a ConnectionString to address ... manage the database table you reference. ... Yep, my latest book can help too, but mostly if you're targeting SQL Server ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: Logging in in background
    ... wold take all kinds of modifictions as I'd need to be checking that each SQL ... my database and all have connection strings associated with them. ... I suspect that there is also an issue on the SQL Server side as I keep ...
    (microsoft.public.access.modulesdaovba)