Results 1 to 9 of 9
  1. #1
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110

    IP Address Directory


    I work in IT at a small medical company and I manage the database for all of our devices, specifically things like computers, multifunction printers, switches, access points, etc. All of these things have IP addresses and I would like to create a query that shows all devices that have an IP address assigned that I can use like an IP directory. I'm relatively new to Access so I'm stumped on how I could do this. Any ideas?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    How do you manage these devices now?
    How do they get assigned IP addresses?

  3. #3
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by orange View Post
    How do you manage these devices now?
    How do they get assigned IP addresses?
    that doesn't seem relevant, If I'm reading the question right.

    without seeing the data, no one can answer this quickly. I'm assuming you have a list of devices that you sell, listed in a table and you want to query the IP field or something??

  4. #4
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110
    In total we have 16 different types of devices and most of them have their own management system.

    Their IPs are assigned when we assign them manually.

    What I have are 16 different tables of different IP devices. I want a single query that shows me all the IP addresses that are currently in use.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Do the 16 tables have similar structure?
    Like deviceId,DeviceName etc that sort of thing?

    If so you might want to do some searching on UNION queries.

  6. #6
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110
    Each table mostly has fields unique to the device but every table has 2 fields in common: DeviceName and IP.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    So, if I understand you correctly, you really want to know which IP addresses are in use.
    So a query that orders the result by IP address may be most handy.

    If your IP address assignments are not grouped by Devicetype, you might want to include a field to identify which Table the IPAddress is in (possibly for further analysis). I was thinking that some devices in the same table may have very different IP addr(eg 231.43.45.6 and another 41.21.4.67 etc so you might want to list a table identifier in the query).
    If so, post back and I'll adjust the sample.

    A UNION query will work and is formatted along these lines. I am using your info that the DeviceName and IPAddr fields are common to all tables.

    SELECT IP, DeviceName FROM Table1
    UNION
    SELECT IP, DeviceName FROM LargeDevices
    UNION
    SELECT IP, DeviceName FROM SmallDevices
    etc. etc.for all tables
    UNION
    SELECT IP, DeviceName FROM OtherDevices
    ORDER BY IP

  8. #8
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110
    Yes! Thank you Orange. That worked like a charm. I also added a WHERE statement to exclude devices that don't have assigned IPs.

    You're right though, I'm going to need a field to show what table the IP address is in. Is there a way to add that just to the query or do I have to add a field to each table and bring it into the query?

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Quote Originally Posted by neo651 View Post
    Yes! Thank you Orange. That worked like a charm. I also added a WHERE statement to exclude devices that don't have assigned IPs.

    You're right though, I'm going to need a field to show what table the IP address is in. Is there a way to add that just to the query or do I have to add a field to each table and bring it into the query?
    Yes. Using my previous example, with the made up table names you could do this.

    SELECT IP, DeviceName ,"Table1" as DevTable FROM Table1
    UNION
    SELECT IP, DeviceName, "Largedevices" as DevTable FROM LargeDevices
    UNION
    SELECT IP, DeviceName, "Smalldevices" as DevTable FROM SmallDevices
    etc. etc.for all tables
    UNION
    SELECT IP, DeviceName, "OtherDevices" as DevTable FROM OtherDevices
    ORDER BY IP
    I think that will work.

    Good luck.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Get Mac Address
    By Mclaren in forum Programming
    Replies: 4
    Last Post: 05-02-2010, 12:34 PM
  2. capturing the address repeatedly
    By simba in forum Forms
    Replies: 12
    Last Post: 03-24-2010, 11:05 AM
  3. how to validate the first line of address
    By dunners92 in forum Access
    Replies: 1
    Last Post: 03-15-2010, 09:53 PM
  4. Replies: 1
    Last Post: 10-07-2009, 08:15 AM
  5. Input Mask for an IP Address and Mack Address
    By baksg1995 in forum Access
    Replies: 18
    Last Post: 06-23-2009, 12:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums