2nd Connection Pass Fails

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am setting up a connection to SQL2000 using the following code:

Dim maindbconnectstring As String = "Data Source=PHx19xxx;Initial
Catalog=My_Database;User Id=myid;Password=mypassword;"

dim cn as sqlconnection
cn.connectionstring=maindbconnectstring

I do the following in my class NEW routine
cn = NEW sqlconnection(maindbconnectstring)

I then execute the following code:

cn.open
do my work
cn.close

I then loop back to the cn.open again (not the actual code)

The first time it works fine. When I loop back and try to open the
connection again, I get a general connection error. I need to stop and Start
SQL 2000 in order to proceed. If I look at the connection before the second
pass, it exists and is closed but I fail when I try to open it. Any
suggestions?
 
When I look at my SQL error log, I get the following errors:

Error 17882, Severity 18, State1 Error accepting connection requewt via
Net-Library 'SSNETLIB' Execution Proceeding

Error 17059, Severity 19, State 0 Operating System error 10061, No
connection could be made because the target machine is actively refusing it.

When I look up the first message, I see that there is a Microsoft HotFix for
this error. I have applied ther latest service pack (SP4) as recommended and
still have the problem.--


Thanks
RonF
 
In reply to Mark's post, I've alredy written my code to do just that. I open
the connection, close it, and loop back to open it again. I get the same
failure even after applying SP4.

I can look at the connection in the debugger and see that it shows up as
open and closed before I try to open it again (by looking at
connection.state). It still shows up as closed after I get my error noted
above.
 
Back
Top