I have developed a VB client application that uses MySQL as the database server. I have included, in the client, a method that monitors the server constantly but it doesn't work really well.
The other day, I have installed windows 2000 server over windows XP pro and then I installed MySQL on it . Then when I run my client on a windows 98 workstation, the client gets in a loop, it gets connected to MySQL then it gets disconnected and over again non stop. What I don't understand is that it worked fine when I had windows XP pro installed and now it just doesn't work. I have included in this message the coding for this function. I'm kinda new in VB so it is possible that my code is bad. Does somebody would have any suggestions about my problem and what I'm doing wrong or what is the best way to monitor a MySQL server to make sure that it is running?

wsConnect is my winsock that connects to the server
tcpCheck is my timer with a delay of 1000
the timer is on my main form so it is enabled when the application starts
bConnected2Server is a flag and if it is false it disable all buttons on my form.
the variable strServerIp gets its value from the registry where the IP address of the server is located.

Private Sub tcpCheck_Timer()
On Error Resume Next
If wsConnect.State <> sckConnected Then
wsConnect.Connect strServerIP, 3306
bConnected2Server = False
bConnected2Server = True
End If

With StatusBar1
If wsConnect.State = sckConnected Then
Set StatusBar1.Panels(1).Picture = ImageList1.ListImages(2).Picture
.Panels(1) = "Connected to server"
.Panels(1).Width = 2310
ElseIf wsConnect.State = sckConnecting Then
.Panels(1).Width = 2310
.Panels(1) = "Connecting to server"
Set .Panels(1).Picture = ImageList1.ListImages(1).Picture
ElseIf wsConnect.State = sckClosed Then
.Panels(1).Width = 2310
.Panels(1) = "Connection closed"
Set .Panels(1).Picture = ImageList1.ListImages(1).Picture
ElseIf wsConnect.State = sckError Then
.Panels(1).Width = 2310
.Panels(1) = "Error connection"
Set .Panels(1).Picture = ImageList1.ListImages(1).Picture
End If
End With

End Sub