If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Determining a user's IP address in VBA

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Apr 2002
Posts: 44
Determining a user's IP address in VBA

I am running networked multi-user database, I am trying to set it up so that when people first connect to the database it updates a table to basically give the current time and their IP address.

This will help me with troubleshooting because if there are any problems with the DB, I can go back and tell who was in it around the time the problem occured.

However, I can't figure out how to return the current IP address in VBA....is there a way?
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 228
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Apr 2002
Posts: 44
well, that will let me look up the IP address for a computer based on their machine name, or look up a machine name based on an IP address, but based on what I can tell, it won't let me know what MY (aka the current user's) IP address is.
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 228
look closer. see the declare for apiGetHostName ? that's the one you'll need. retrieve the local machine name and resolve it with the other functions.
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: Apr 2002
Posts: 44
okay, I see the declare for the apiGetHostname, but I then do not see that function used anywhere in the code....I don't think I understand how to use it...
Reply With Quote
  #6 (permalink)  
Old
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 228
You can use it after fInitializeSockets as in:

dim strHostName as string * 256
gethostname(strHostName, 256)

like all the api functions using strings you need to supply it with a prefilled string.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On