If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Monitoring MySQL server

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-10-03, 18:36
CM2003 CM2003 is offline
Registered User
 
Join Date: Oct 2003
Posts: 1
Monitoring MySQL server

Hello,

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.Close
wsConnect.Connect strServerIP, 3306
bConnected2Server = False
Else
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
DoEvents

End Sub
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On