Solved

Create an IP address lookup in an Access Form

Posted on 2013-06-12
3
434 Views
Last Modified: 2013-06-18
Hello...I would like to build a Form in Access 2010 and code it to lookup the IP address and return any available information. See the picture below for an idea. I know I can write and shell a .bat file using the nslookup CMD. I just need to find out how to read the return info into a text box in the form... or if you know of an easier method please suggest it!

0
Comment
Question by:Jeffrey Reep
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 28

Assisted Solution

by:omgang
omgang earned 250 total points
ID: 39241985
Try this function
OM Gang



Public Function GetIPAddy() As String
On Error GoTo Err_GetIPAddy

    Dim oAdapter As Object, oNic As Object
    Dim strIP As Variant

    Set oAdapter = GetObject("winmgmts:").InstancesOf("Win32_NetworkAdapterConfiguration")

    For Each oNic In oAdapter
        If oNic.IPEnabled Then
            strIP = oNic.IPAddress(0)
        End If
    Next
   
Exit_GetIPAddy:
    GetIPAddy = strIP
    Set oNic = Nothing
    Set oAdapter = Nothing
    Exit Function

Err_GetIPAddy:
    MsgBox Err.Number & " (" & Err.Description & ") in procedure GetIPAddy of Module Module3"
    Resume Exit_GetIPAddy

End Function
0
 
LVL 40

Accepted Solution

by:
als315 earned 250 total points
ID: 39242009
Try this sample
DBIP.accdb
0
 

Author Closing Comment

by:Jeffrey Reep
ID: 39257749
Both good starts... with some modification they are perfect. Thanks!
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question