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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Aks 2010
    New Member
    • Aug 2010
    • 13

    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.num ber.number.numb er) 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.....
  • liimra
    New Member
    • Aug 2010
    • 119

    #2
    Possible Solution

    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

    Comment

    • Aks 2010
      New Member
      • Aug 2010
      • 13

      #3
      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!

      Comment

      • liimra
        New Member
        • Aug 2010
        • 119

        #4
        Se//

        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
        Code:
        [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:

        Code:
        If (DCount("[IP]", "QueryName", "[IP] =" & "[Forms]![FormName]![IP]")) >= 1 Then
        MsgBox "This IP exists"
        ElseIf (DCount("[IP]", "QueryName", "[IP] =" & "[Forms]![FormName]![IP]")) = 0 Then
        MsgBox "This IP is New"
        End If
        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

        Comment

        • Aks 2010
          New Member
          • Aug 2010
          • 13

          #5
          thank you Ali

          Comment

          • liimra
            New Member
            • Aug 2010
            • 119

            #6
            Glad


            You
            are most welcome.

            Regards,
            Ali

            Comment

            Working...