Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IP Address Validation 1

Status
Not open for further replies.

Aiii

Technical User
May 7, 2003
18
AU
Hey,

I'm doing a database for NT server inventory and i was wondering if there is a validation rule or something of the like for entering IP addresses.

I tried putting in an Input Mask of "###.###.###.###" but it doesnt work too well.

Any help is greatly appreciated.
 
Use the following:
Format: @@@\.@@@\.@@@\.@@@
Input Mask: 000.000.000.000

This will validate that numbers 0-9 are entered for each character. The storage of the data is without the period(.). The display then is controlled by the Format and it will again display it as it was inputted.

This should do it for you.

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Hmm, yeah it works ok, but if i have an IP address like 178.17.133.7 it wont let me add it.
 
Sorry, apologies given here. Forgot about the single and tens entries. I think we need to store the number with the periods included . This format as you know saves the entry without the spaces entered. So, for reports and viewing the IP addresses will look good. When in the editing mode it will still have a left justified look between the periods.

Here is the InputMask for this: ###.###.###.###;0;_

Let me know how this works as

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
There is another current thread that is dealing with this same issue. I just noticed it.

thread702-550932

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Ok, thanks for that

The ###.###.###.###;0;_ input mask worked well.

See, what happened with the input mask ###.###.###.### was that if you didnt put a space, it would push all numbers over to the left, which would give you an incorrect number.

But adding the ;0;_ at the end of it seems to have worked.

Thanks for the link to the other thread aswell, although some of the solutions in there makes the mind boggle.

Just needed something simple and you provided it for me.

Thanks so much
 
But adding the ;0;_ at the end of it seems to have worked
This added on the end indicates to store the entry with the period include in the string. If you use the wizard to create an input mask and select social security number as the form your will find that the last screen before saving has two radial buttons. On if you want the hypens stored in the field and one to remove the hyphen before saving. I knew about that so I tried it and then changed mask to zeroes with the period seperator and it seemed to work.

Good luck with your project now.

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top