Use of IP addresses in DB

cdcox

Registered User.
Local time
Today, 06:15
Joined
Aug 29, 2005
Messages
21
we want to run a ping command via a radio button or command button. We have IP addresses set up for multiple pieces of equipment, each IP address consisting of 4 different text boxes. We want to be able to launch a ping and have the program read the values from each of the 4 text boxes that make up the IP address.

Any ideas/suggestions greatly appreciated.
 
Can you do a DOS batch file and run it?
 
Search for the keyword ping @ VBnet for a listing of VB solutions.
 
A DOS batch file would be handy if we knew the IP address in advance. What we want to accomplish is to read the values from 4 different text boxes (each text box consisting of one octet of the IP address) after clicking on a command button, then ping that IP address.
 
You can create a Dos batch file on the fly from access :)

Its just a text file by another name.
Lookup 'Print # Statement' in Help

HTH

Peter
 
Didn't find too much on that--I am an Access newbie, plain and simple. What is the easiest way to read values from four different text blocks and use them as an argument to a ping command?
 
Or maybe even "Ping %1" in the .bat file and you would not even have to create the .bat file!
 
From gHudsons advice:

'ping the IP by passing the address,
'text to send, and the ECHO structure.
success = Ping((Text1.Text), (Text2.Text), ECHO)
 
I don't know ping but Access will be something like

Open "c:\ping.bat" For Output As #1 ' Open file for output.
Write #1, "ping " & Me.Textbox1 & "." & Me.Textbox2 & "." & Me.Textbox3 & "." & Me.Textbox4
Close #1 ' Close file.
Shell ("c:\ping.bat")

HTH

Peter
 
I am uploading a screenshot of what we're looking at. Based on what you've told me, will that work for the IP address text boxes at the bottom? Thanks.
 

Attachments

You need to concatenate the IP quads first:

txtIP = Quad1& "." & Quad2 & "." & Quad3 & "." & Quad4

Then you can use txtIP in your PING or Batch call or whatever.
 
I figured I would have to do that--I just don't know where to put that line??????
 
You are looking at doing something that is not normally done this particular way, not that you couldn't try it.

The issue is that most TCP/IP protocols are interactive to a command line, not a GUI. Hey, that won't stop you. It just makes life more difficult. I cannot do the best possible searches where I am because I am far from my home site. 'bout 580 miles from home.

Anyway, try to GOOGLE-search "PING" + "RFC" and see what articles have to say about the PING command. The RFC articles will describe some salient point about TCP or IP or both. Find an RFC article on PING and you'll learn more than you ever wanted to know about it.

The catch with PING is that, like most protocols, the response is not a STATUS CODE but is rather a text-like reply that will have to be captured and parsed out to see what your results were. Also, depending on your implementation of your protocol stack, PING might be unlimited. Therefore, when you build your commands, don't forget to limit the number of PING iterations.

You might look up the Shell function as a way to spawn a PING process and then trap the return. But there are many ways to skin a cat here. MMMMEEEEOOOOWWWWWRRRRRR :eek:

(Sorry, kitty!)
 
are you expecting to get a return value to Access or do you just want to run ping?

Running ping should not be too bad but getting a return value is a whole new ball game

Peter
 
I was thinking along the same lines as Doc. Use the Shell command to run the PING but redirect the output to a text file. Then use Open and Line Input to read in the text file and check for the results.
 
I don't need anything returned to Access--I just want Access to read the octet values from each of the 4 text boxes and ping that particular IP address. I can do it if the IP address is known. You can use a command button to initiate a ping command and determine continuity. The problem is getting Access to READ the values in those text boxes before initiating a ping command. Additionally, part of the command would have to place dots in between the octets.
 
That is what ScottGems code does!
txtIP = Quad1& "." & Quad2 & "." & Quad3 & "." & Quad4

Stick that in the comand button before the ping statement, txtIP is your IP address

Peter
 

Users who are viewing this thread

Back
Top Bottom