Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Jorrel Detaunan
  Where is Jorrel Detaunan?
 Las Piñas
 Philippines
 Jorrel Detaunan
 Tags
Subject: RE: Alternative Way to PING IP
Thread ID: 204805 Message ID: 204811 # Views: 54 # Ratings: 0
Version: Visual FoxPro 9 Category: Win32API programming
Date: Monday, November 24, 2008 7:04:29 AM         
   


> Hi there!
>
> can i ask for other alternative way to ping IP?
> im currently using this:
>
>
> Lparameters iHost
> Declare Integer GetRTTAndHopCount In Iphlpapi;
> 	Integer DestIpAddress, Long @HopCount,;
> 	Integer MaxHops, Long @RTT
> Declare Integer inet_addr In ws2_32 String cp
> 
> Local nDst, nHop, nRTT
> nDst = inet_addr(iHost)
> Store 0 To nHop, nRTT
> 
> If GetRTTAndHopCount(nDst, @nHop, 50, @nRTT) <> 0
> 	Return .T.
> 
> Else
> 	Return .F.
> Endif
> 

>
> this is to check if the servr is up and running.
> don't know why but sometimes it returns .F. even the server is up.
> but when i try to proceed with my connection string, it connects w/o any errors.
>

Hi Jorrel,

If your goal is to check whether you can connect to the database server on that server machine, I'd try to connect directly. Perhaps something like:
Local lnConnection
SQLSETPROP(0,"DispWarnings",.F.)
SQLSETPROP(0,"DispLogin",3)
lnConnection = SqlStringConnect(...
If m.lnConnection < 0
    && failed, AError(), perhaps a MessageBox(), and so on


PS: See also the SqlSetProp 'ConnectTimeOut' parameter.


hth
-Stefan



COMPLETE THREAD
Alternative Way to PING IP Posted by Jorrel Detaunan @ 11/24/2008 2:53:45 AM
RE: Alternative Way to PING IP Posted by Stefan Wuebbe @ 11/24/2008 7:04:29 AM