Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: Patrick McGreevy
  Where is Patrick McGreevy?
 Clarksville
 Tennessee - United States
 Patrick McGreevy
 To: Jorrel Detaunan
  Where is Jorrel Detaunan?
 Las Piñas
 Philippines
 Jorrel Detaunan
 Tags
Subject: RE: VFP9 Ping, MySql ODBC Driver
Thread ID: 181730 Message ID: 183173 # Views: 34 # Ratings: 0
Version: Visual FoxPro 9 Category: Network and Computer Management
Date: Saturday, July 12, 2008 4:39:33 AM         
   


> >
> >
> > 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...

Jorrel,

Just pinging the server won't tell you whether you are connected(logged on) or not.

It won't even tell you whether you have access to the server or domain. All it will tell you is whether the machine is turned on or not.

If the server is on, the ping will return four responses. If it isn't, you will get errors.

To confirm you are connected, and can read/write files to it, just copy a small .txt file
to it. Then check for it's existence(DOS='If Exist myfilename',VFP='If File 'myfilename')
will tell you whether or not you are talking or not.

This is the simple approach. You can do the same thing through Windows API's, but with more coding.

Woops! I think Pete's approach will also verify that you are in fact online with the server!

I did not read his reply as closely as I should have. Sorry.

Pat



COMPLETE THREAD
VFP9 Ping, MySql ODBC Driver Posted by Jorrel Detaunan @ 7/5/2008 4:08:22 AM
RE: VFP9 Ping, MySql ODBC Driver Posted by Lyrad Bangoy @ 7/5/2008 4:38:24 AM
RE: VFP9 Ping, MySql ODBC Driver Posted by Eric den Doop @ 7/5/2008 7:56:26 AM
RE: VFP9 Ping, MySql ODBC Driver Posted by Lyrad Bangoy @ 7/5/2008 8:13:14 AM
RE: VFP9 Ping, MySql ODBC Driver Posted by Carlos Alloatti @ 7/7/2008 2:59:32 PM
RE: VFP9 Ping, MySql ODBC Driver Posted by Jorrel Detaunan @ 7/8/2008 3:43:57 AM
RE: VFP9 Ping, MySql ODBC Driver Posted by Pete Sass @ 7/7/2008 5:13:01 PM
RE: VFP9 Ping, MySql ODBC Driver Posted by Jorrel Detaunan @ 7/8/2008 3:45:47 AM
RE: VFP9 Ping, MySql ODBC Driver Posted by Patrick McGreevy @ 7/12/2008 4:39:33 AM
RE: VFP9 Ping, MySql ODBC Driver Posted by Pete Sass @ 7/16/2008 7:39:25 PM