5 Replies - 2829 Views - Last Post: 11 March 2013 - 10:38 AM Rate Topic: -----

#1 miss_crimson  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 8
  • Joined: 28-January 12

Code in checking the server connection status with the vb6 system.

Posted 10 March 2013 - 03:06 PM

Hi programmers! I would like to ask you if you have idea on how to check if the server is down within your vb application.

I've been trying to search this for long, and found using winsock but the problem is, I need to open the other vb6 application (in our case we have distributed system connected via network) whenever I need to check the connection status to its server, and our teacher said that it must not be dependent on the other application. An application from one site can check the connection status of the sql server from the other computer in another site... I just need the code in checking it, does someone know it?

the code goes like this:
CODE IN MY FORM_LOAD SUB:
Winsock.RemoteHost = "IP address of the other computer"                      
Winsock.LocalPort = 15151 'open the port on the local machine 
Winsock.Listen ' start listening

CODE I PUT WHEN SAVE BUTTON IS CLICK:
If Winsock.State = sckConnected Then
    'do action when connected
else
  'not connected
endif




This code works when the other vb6 application is open...
But i can't use this since I need to check the server status of the other site without running the other vb6 application.... :(/>

Is This A Good Question/Topic? 0
  • +

Replies To: Code in checking the server connection status with the vb6 system.

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,755
  • Joined: 26-March 09

Re: Code in checking the server connection status with the vb6 system.

Posted 11 March 2013 - 01:17 AM

You could look at doing a ping against the server to see if it's on, maybe that will do what you need.
Was This Post Helpful? 0
  • +
  • -

#3 miss_crimson  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 8
  • Joined: 28-January 12

Re: Code in checking the server connection status with the vb6 system.

Posted 11 March 2013 - 03:33 AM

View Postmaj3091, on 11 March 2013 - 01:17 AM, said:

You could look at doing a ping against the server to see if it's on, maybe that will do what you need.



Yeah, that's what i'm also thinking, but i'm wondering if it's possible with vb6 and sql server 2000?
Was This Post Helpful? 0
  • +
  • -

#4 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,755
  • Joined: 26-March 09

Re: Code in checking the server connection status with the vb6 system.

Posted 11 March 2013 - 04:53 AM

You use the ping to check the server is on the network (the PC, not the SQL server instance).

You could then try to open a connection to the SQL Server on the that machine (assuming it is configured from remote connections).
Was This Post Helpful? 0
  • +
  • -

#5 miss_crimson  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 8
  • Joined: 28-January 12

Re: Code in checking the server connection status with the vb6 system.

Posted 11 March 2013 - 09:22 AM

View Postmaj3091, on 11 March 2013 - 04:53 AM, said:

You use the ping to check the server is on the network (the PC, not the SQL server instance).

You could then try to open a connection to the SQL Server on the that machine (assuming it is configured from remote connections).



okay got it. can i know the syntax in pinging?
Was This Post Helpful? 0
  • +
  • -

#6 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,755
  • Joined: 26-March 09

Re: Code in checking the server connection status with the vb6 system.

Posted 11 March 2013 - 10:38 AM

I'm sure you can operate Google as well as I can miss_crimson. :)

This is microsoft's example, but there are numerous examples online.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1