473,321 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

How to format ip address input and check for it in the database

hello...


can any one have idea and help me about:

- i want create field that make format of IP Address with dots(number.number.number.number) at maximum 4 number in each digit!
like the setting of DNS in internet browser!!



-code that check if the IP Address used in database
like the moethod that used when sign up in website that check if the nicknames is already used!!



-Create history of users that loggin in database and what they change!



thanks in advance.....
Aug 20 '10 #1

✓ answered by liimra

For the second point, I would recommend a message box.

As I stated previously, you create the four fields and then join them in a field of a query
Expand|Select|Wrap|Line Numbers
  1. [a]&"."&[b]&"."&[c]&"."&[d]
and you call this field IP

In the form where you enter new records (IP) which is based on the Query (with IP field), you add a button which will tell you whether this IP was used or not with this code:

Expand|Select|Wrap|Line Numbers
  1. If (DCount("[IP]", "QueryName", "[IP] =" & "[Forms]![FormName]![IP]")) >= 1 Then
  2. MsgBox "This IP exists"
  3. ElseIf (DCount("[IP]", "QueryName", "[IP] =" & "[Forms]![FormName]![IP]")) = 0 Then
  4. MsgBox "This IP is New"
  5. End If
  6.  
This will count the records with the same IP and return the first message if it was used before and second one if it is the first time to be used.

Sure you can attach this msgbox to any other event.

As for the third point, I would stick to my first reply. Note that you can add User's Table for this purpose so that users will enter their names upon opening the database and then you get the same into the IP userID using DLast
Regards,
Ali

5 5128
liimra
119 100+
There might be other solutions but this is a work around I know.
You have to create four different number fields one for each part. Then you add them up in a Query. For example you create fields [a], [b], [c], & [d]. When you enter the IP you enter it as parts but in the query (another table) you will join them together. You create a query based on the IP table and add a field (Column) in query design view as: IP: [a]&"."[b]&"."[c]&"."[d]/// or [a]&"."[b]&"."[c]&"."[d] AS IP in query SQL view.

For the second point. How do you want to know if this IP has been used before? Popup Message, Report, Form, Or Just Query.
For me, I see the best is through a button which will open a pop up small report to tell you if it has been used before.

As for the third point. I don't think this is possible assuming you are using Access 2007 as I do, unless you create different front ends for each user and then add "user" field to each table. In this way, you will be able to track who added records but not who deleted them. The good thing about access is that you are always able to find work around. You can create memo field with history and add macro actions to the delete button you create.

Hope this helps,
Regards,
Ali
Aug 22 '10 #2
hello Ali

sorry i was busy so i stop my work
i will continued now

thank you for help me


about second point i need it like pop up or icon for true or false sign


about third point
iknow there are code for history login without what the user do in data!
i do searching but i dont found good one!
Sep 3 '10 #3
liimra
119 100+
For the second point, I would recommend a message box.

As I stated previously, you create the four fields and then join them in a field of a query
Expand|Select|Wrap|Line Numbers
  1. [a]&"."&[b]&"."&[c]&"."&[d]
and you call this field IP

In the form where you enter new records (IP) which is based on the Query (with IP field), you add a button which will tell you whether this IP was used or not with this code:

Expand|Select|Wrap|Line Numbers
  1. If (DCount("[IP]", "QueryName", "[IP] =" & "[Forms]![FormName]![IP]")) >= 1 Then
  2. MsgBox "This IP exists"
  3. ElseIf (DCount("[IP]", "QueryName", "[IP] =" & "[Forms]![FormName]![IP]")) = 0 Then
  4. MsgBox "This IP is New"
  5. End If
  6.  
This will count the records with the same IP and return the first message if it was used before and second one if it is the first time to be used.

Sure you can attach this msgbox to any other event.

As for the third point, I would stick to my first reply. Note that you can add User's Table for this purpose so that users will enter their names upon opening the database and then you get the same into the IP userID using DLast
Regards,
Ali
Sep 14 '10 #4
thank you Ali
Sep 18 '10 #5
liimra
119 100+

You
are most welcome.

Regards,
Ali
Sep 18 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jack | last post by:
Hi, I have the following code which displays email address from a database However, I need to have the email address highlighted so that on clicking the email box would open up with the email name...
7
by: Jared Evans | last post by:
I developed a console application that will continually check a message queue to watch for any incoming data that needs to be inserted into MS SQL database. What would be a low-cost method I...
2
by: JP SIngh | last post by:
Hi All We are creating a multi-region ASP application which will be using SQL Server 2000. As our users exist in multiple location i.e. UK, US, Australia how can we distinguish that the date...
5
by: turnitup | last post by:
I have found that by far the easiest way to store dates in my LAMP application is in a text string in the database in Unixtime format. First of all, what would be the most efficient data type to...
1
by: aj | last post by:
What is the difference (if any) between inspect check database and db2dart ??? Do they both find the same potential problems? Does one provide more comprehensive checking than the other? ...
2
by: vadiraj86 | last post by:
how to check database is present or not before opening a connection I want to know how to check is databse present or not
2
by: jl2886 | last post by:
I have three questions: I have a variable that is going to be input with a monetary amount and upon update of that variable i want another field in the form to be populated with the now date. I...
0
by: =?Utf-8?B?cGF0cmlja2RyZA==?= | last post by:
Hi everyone! I have these three questions and though to post them in a single thread: 1) I have created a textarea: <textarea id="txtCards" cols="50" rows="15" runat="server" wrap="virtual"...
1
by: kasturi207 | last post by:
I want to validate input (text) which i have to check with databse record is exist. the code something like that:- <cfscript> function checkkp() { if (rscheck.recordcount NEQ 0) {...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.