Results 1 to 6 of 6
  1. #1
    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?

  2. #2
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    228

  3. #3
    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.

  4. #4
    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.

  5. #5
    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...

  6. #6
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •