> 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