IP Address, Computer names and such.

snicker

Registered User.
Local time
Today, 11:46
Joined
Aug 8, 2003
Messages
91
I am wanting to come up with a db that will read the IP Addy from the local machine, and store it in a table. Now I am new at API and need some help. I found this on google http://www.mvps.org/access/api/api0067.htm but cant get it to work. They make it sound sooo easy. LOL If its really easy would someone help me out with an example? Or at least tell me if it works for you.

Thx in advance
Mike

Windows XP
Office XP Devoloper
 
If it helps, this is how to get the user name.
(Works for win2000 and xp, dunno about the rest.)

User = Environ("USERNAME")
 
if you can somehow import the winsock library you can create a "WinSock" object and get the LocalIP property.
 
Dev's Perform IP Lookups and resolve addresses API worked for me using Access 97. I just threw it all into a module and ran this function...
Code:
Public Function IPAddress()
    
    MsgBox "The IP address for this computer is:  " & fGetHostIPAddresses(Environ("ComputerName")).Item(1)
    
End Function
 
Thx for all the help on this one. I still didnt have any luck. I'm sure its because I just dont have a clear understanding on winstock and API stuff. I'm going to look into this one a little more. Any further info one this subject is welcome.

With that being said, I need to put this on the back burner for now. I'll just have to do inventory manually this year. Though I'm going to follow any further posts very closely.

Thx Again, you guys rock.
Mike
 

Users who are viewing this thread

Back
Top Bottom