I'm a total Access newbie, please bear with me! Using Win2K/Access 2003.
I'm trying to create a table in which I can store IP addresses and other information. According to Microsoft, there is no native way of converting an IP address to an integer/long number (which is much more efficient to index and search). After searching, I found a function which is able to take either an IP address or integer and convert it to the other.
In the table, Address is type Number. My form has a Text Box for entering the IP address. But Access throws an error because it reads the dotted decimal as a String/Text type.
I would like to be able type a string into the form as a dotted decimal and have it _displayed_ as a string (easier for me to read), but _saved_ as a Number in the table (after calling this external function stored in a standard module). Also, it would be nice to have the form and/or report display the dotted decimal when reviewing previous entries.
Is this possible with a single Text Box? If so, could you please describe what I would need to do?
7 3525 Rabbit 12,516
Recognized Expert Moderator MVP
I'm a total Access newbie, please bear with me! Using Win2K/Access 2003.
I'm trying to create a table in which I can store IP addresses and other information. According to Microsoft, there is no native way of converting an IP address to an integer/long number (which is much more efficient to index and search). After searching, I found a function which is able to take either an IP address or integer and convert it to the other.
In the table, Address is type Number. My form has a Text Box for entering the IP address. But Access throws an error because it reads the dotted decimal as a String/Text type.
I would like to be able type a string into the form as a dotted decimal and have it _displayed_ as a string (easier for me to read), but _saved_ as a Number in the table (after calling this external function stored in a standard module). Also, it would be nice to have the form and/or report display the dotted decimal when reviewing previous entries.
Is this possible with a single Text Box? If so, could you please describe what I would need to do?
You can do this with the input mask but my question is why save it as a number when ip shouldn't be treated as a number unless it's in its binary format.
You can do this with the input mask but my question is why save it as a number when ip shouldn't be treated as a number unless it's in its binary format.
Rabbit, thanks for your quick reply. I've looked into your suggestion. An input mask seems to define a format for displaying data, but not doing anything with the data. For example, a phone number input mask could be: (999) 999-9999, specifying that digits are not required where the "9" is, plus and minuses are not allowed, but spaces are. A user could enter "(123) 555-" and that would be a valid entry for this input mask. Depending upon the option of the mask, Access could store "123555" or "(123) 555-".
It seems you are not aware that an IP address can be converted to a number. (Search for "inet_aton" and "inet_ntoa" .) In applications where one needs to search over a range of IP addresses, or see if a given IP comes before or after another, being able to convert them to numbers makes comparisons very easy. It is unfortunate that Microsoft chose not to include this functionality in Access.
What I want is to enter, for example, "127.0.0.1" , and store "2130706433 ".
( (127*256^3)+(0* 256^2)+(0*256^1 )+(1*256^0) = 2130706433. ) And when I view the form or report, I want Access to pull "2130706433 " from the record, and display "127.0.0.1" . Unless the input mask can call external functions, I don't see how the input mask would help me here.
Is there a binary type available? I only saw Byte type. If I'm reading the help file properly, I would guess that this actually only stores one bit of information ('yes' or 'no', 'off' or 'on', '1' or '0', etc.).
Best regards.
Rabbit 12,516
Recognized Expert Moderator MVP
Rabbit, thanks for your quick reply. I've looked into your suggestion. An input mask seems to define a format for displaying data, but not doing anything with the data. For example, a phone number input mask could be: (999) 999-9999, specifying that digits are not required where the "9" is, plus and minuses are not allowed, but spaces are. A user could enter "(123) 555-" and that would be a valid entry for this input mask. Depending upon the option of the mask, Access could store "123555" or "(123) 555-".
It seems you are not aware that an IP address can be converted to a number. (Search for "inet_aton" and "inet_ntoa" .) In applications where one needs to search over a range of IP addresses, or see if a given IP comes before or after another, being able to convert them to numbers makes comparisons very easy. It is unfortunate that Microsoft chose not to include this functionality in Access.
What I want is to enter, for example, "127.0.0.1" , and store "2130706433 ".
( (127*256^3)+(0* 256^2)+(0*256^1 )+(1*256^0) = 2130706433. ) And when I view the form or report, I want Access to pull "2130706433 " from the record, and display "127.0.0.1" . Unless the input mask can call external functions, I don't see how the input mask would help me here.
Is there a binary type available? I only saw Byte type. If I'm reading the help file properly, I would guess that this actually only stores one bit of information ('yes' or 'no', 'off' or 'on', '1' or '0', etc.).
Best regards.
I am aware it can be converted into a base 10 number. I was just under the impression you wanted to store 127.0.0.1 as 127001.
In this case you're going to need an intermediary unbound textbox. One text box will be where they enter in the ip address in the format you describe. In the after update event of that text box, that number will be converted and stored into the field. While in the On Current event of the form, it retrieves the number and converts it back and stores it to the text box.
In this case you're going to need an intermediary unbound textbox. One text box will be where they enter in the ip address in the format you describe. In the after update event of that text box, that number will be converted and stored into the field. While in the On Current event of the form, it retrieves the number and converts it back and stores it to the text box.
Thank you for the description of the use of an intermediary text box. I'll attempt to implement this dual-text box set up today.
Best regards.
UPDATE:
After poking around the form builder, I find I need some further clarification.
Per your suggestion, I've added an unbound text box (UBox) taking a string/text type for the dotted decimal address. UBox's After Update event is defined as "[IP]![Address] = IPConvert ([Me].[UBox])". (I don't know if this is the correct syntax or not to assign the value typed into UBox to the field Address.)
I found the "On Current" event field for the form, but am confused as to how it updates a particular element on the form, i.e. my Address text box. Could you be more specific on how to use the form's On Current event to retrieve a value from the table, pass it as a parameter to a VB function, and put the returned value into an individual element of a form?
Thanks for your help.
Rabbit 12,516
Recognized Expert Moderator MVP
Thank you for the description of the use of an intermediary text box. I'll attempt to implement this dual-text box set up today.
Best regards.
UPDATE:
After poking around the form builder, I find I need some further clarification.
Per your suggestion, I've added an unbound text box (UBox) taking a string/text type for the dotted decimal address. UBox's After Update event is defined as "[IP]![Address] = IPConvert ([Me].[UBox])". (I don't know if this is the correct syntax or not to assign the value typed into UBox to the field Address.)
I found the "On Current" event field for the form, but am confused as to how it updates a particular element on the form, i.e. my Address text box. Could you be more specific on how to use the form's On Current event to retrieve a value from the table, pass it as a parameter to a VB function, and put the returned value into an individual element of a form?
Thanks for your help.
I guess IP is the name of your table? But I assume that your table is also the record source of your form. In which case you can use Me.Address even though it's not a control on your form. So Me.Address = IPConvert(Me.UB ox).
As for the On Current event. You would do Me.UBox = ReverseConvert( Me.Address). Or whatever your reverse conversion function is called.
I guess IP is the name of your table? But I assume that your table is also the record source of your form. In which case you can use Me.Address even though it's not a control on your form. So Me.Address = IPConvert(Me.UB ox).
As for the On Current event. You would do Me.UBox = ReverseConvert( Me.Address). Or whatever your reverse conversion function is called.
yes, IP is the name of the table (creative, isn't it? ;) ).
Thank you again, Rabbit, for the quick replies. Your advice was very helpful in making progress on this issue. I hope to be more clear in the future as I learn the lingo of Access.
Best regards!
Rabbit 12,516
Recognized Expert Moderator MVP
Not a problem, good luck.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Frio |
last post by:
VB.net help file provided the following excerpt for the SetToolTip method:
**********
Remarks
In addition to specifying the ToolTip text to display for a control, you can
also use this method to modify the ToolTip text for a control. Calling the
SetToolTip method more than once for a given control does not specify
multiple ToolTip text to display for a control but instead changes the
current ToolTip text for the control. To determine...
|
by: dskillingstad |
last post by:
I've been struggling with this problem for some time and have tried
multiple solutions with no luck.
Let me start with, I'm a novice at Access and I'm not looking for
someones help to design my database,just help in getting me pointed in
the right direction.
I have a database with 8 tables, which from what I have read, cannot be
linked on a single form, and be updatable. I have created a query
which includes all 8 tables, and then...
|
by: .Net Newbie |
last post by:
Hello,
I am currently coding my ASP.Net pages in c# and have run into a question
concerning Emails. I have four objects on a page (six including 2 buttons).
The first is a subject line (textbox) , the next is the email body (a
Textbox with multiple rows), an email address (textbox), and a DropDownList
containing multiple email addresses (populated from a SQL Server table).
The way this page functions is that a user types in the email...
|
by: Neo Geshel |
last post by:
Greetings
I am using VB in my ASP.NET project that uses an admin web site to
populate a database that provides content for a front end web site. I am
looking for a way to use replace() to replace multiple entries of an
object within a string. That is, if a user hit twice to create
one new line, but just once to create another, I want both types
( & twice
to create a new line (by creating a blank line between paragraphs). ...
|
by: Matt D |
last post by:
I've got two web services that use the same data types and that
clients will have to consume. I read the msdn article on sharing types
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service07162002.asp)
but I don't want clients to have to add two web references and then
manually have to edit the proxy classes. After doing some searching I
found that putting references to multiple web services in a .disco...
| |
by: Eric Lindsay |
last post by:
I can't figure how to best display little snippets of shell script using
<pre>. I just got around to organising to bulk validate some of my web
pages, and one of the problems occurs with Bash shell pieces like this:
<pre><code>
#!/bin/sh
ftp -i -n ftp.server.com< <EOF
user username password
epsv4
cd /
|
by: Brad |
last post by:
I have a .net 2.0 web application project that creates a pdf file, saves the pdf to disk (crystal reports does this
part), and
then my code reads the pdf file and writes it to the httpresponse The web app works great on win2003 and xp and the end
result is a pdf file is displayed in the browser. When I run the same code on Vista, the browser displays the message
"Internet Explorer cannot display the web page". If I open the same...
|
by: nicky123 |
last post by:
Hi everyone,
This is a brief description that I have provided for parsing & displaying an XML document using DOM API. Please feel free to post your own comments & views regarding this discussion. Thank you.
The first step of parsing an XML document is to import the DOM API related classes such as :-
java.io.* which contains all the interfaces to perform an I/O operation.
org.xml.sax.* which contains all the interfaces...
|
by: bonneylake |
last post by:
Hey Everyone,
Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place.
what i am trying to display previously entered multiple fields. I am able to get my serial fields to display correctly, but i can not display my parts fields correctly.
Currently this is what it does
serial information 1
parts 1
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |