Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 trap connection error

Author  Topic 

jhun_garma
Starting Member

15 Posts

Posted - 2002-03-12 : 21:58:10
i have an application that connects to an sql 2k server via internet.
my problems is i want to trap an error "general network error".
since everytime i get this error the system crashes. this occurs everytime the application loses its connection.

any suggestions on how to do it in vb6

many thanks in advance
jhun

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-03-12 : 23:40:28
jhun_garma

a couple of questions...

quote:

i have an application that connects to an sql 2k server via internet.


Do you mean ASP? Or do you mean you're connecting to some server which is not at your site via TCP/IP?

quote:

since everytime i get this error the system crashes.


When you say the system crashes, do you mean your ASP page? SQL Server? IIS Server? Network?

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

jhun_garma
Starting Member

15 Posts

Posted - 2002-03-12 : 23:46:09
a visual basic application using tcp/ip. the program crashes thats why i need to trap it

thanks
jhun


Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-03-12 : 23:59:50
quote:

a visual basic application using tcp/ip. the program crashes thats why i need to trap it



And

Public Sub Connect()
On error goto Err_Sub

Dim db as NEw ADODB.Connection
db.Open sProvider

db.Close
Set db = Nothing

Exit Sub
Err_Sub:
MsgBox "Error"
End Sub


Doesn't catch the error?

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"

Edited by - rrb on 03/13/2002 00:14:47
Go to Top of Page

byrmol
Shed Building SQL Farmer

1591 Posts

Posted - 2002-03-13 : 00:18:44
jhun,

Have you had a look at the events associated with the connection object?

eg..

'Module or class declaration
'Connection Instance
Private WithEvents mCNN As ADODB.Connection


Then have a look a the methods for its event...

I think you are after "Disconnect" or "InfoMessage"...

HTH

DavidM

Tomorrow is the same day as Today was the day before.
Go to Top of Page
   

- Advertisement -