?
Solved

Create an IP address lookup in an Access Form

Posted on 2013-06-12
3
Medium Priority
?
441 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 750 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 750 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

771 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