> > Hello there! Can someone help me about pinging an ip address? im using MySQL as my backend but everytime the server is down, the MySQL ODBC connection settings always pop up. If i could just ping the ip address on the first place i could control the errors occuring. Or maybe to add additional control in the connection string to block the pop-up window.
> >
> > and one more thing... how can i check if the server is still active? Ex: I am connected to the server and suddenly the connetion broke.
> >
> > Thank you...
>
>
> Morning from Canada,
> If you need to ping an ip address to verify if the server
> is attached on your network the below code works as I am
> using it all the time.
>
>
* --- PingAPI.prg - Coded as a function.
> * --- Format : lIPthere=PingAPI("10.162.15.75")
> LPARAMETERS lChkIP
> DECLARE INTEGER GetRTTAndHopCount IN Iphlpapi;
> INTEGER DestIpAddress, LONG @HopCount,;
> INTEGER MaxHops, LONG @RTT
>
> DECLARE INTEGER inet_addr IN ws2_32 STRING cp
>
> LOCAL nHop, nRTT
> nIPDest = inet_addr(lChkIP)
>
> IF GetRTTAndHopCount(nIPDest, @nHop, 1, @nRTT) <> 0
> RETURN .T.
> ELSE
> RETURN .F.
> ENDIF
>
>
> Pete "the IceMan", from the Great White North of Canada.
Thank you for helping me about the ping issues, but recently i have found a new and easier solution.
i just tried adding "OPTION=3" to my connection string, and here it goes:
Driver=MySQL ODBC 3.51 Driver;Server=TheIPAdd;Port=ThePort;Database=TheDatabase;User=Root;Password=Root;Option=3;
There ^_^. the mysql login window won't pop-up.
but pinging the server is more challenging, fun, exiting...
thnk again...