Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Old 05-27-2006, 12:23 AM   #1
Tsango
Registered User
 
Join Date: Mar 2006
Location: Birmingham, UK
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
Tsango has a little shameless behaviour in the past
Computer Name or ID

Anyone know how to get the computer ID or name unique to your computer?

I want to be able to use it in a database to keep logs for each computer on the network.

Any ideas?

Tsango is offline   Reply With Quote
Old 05-27-2006, 12:30 AM   #2
Rich
Guest
 
Posts: n/a
Use the search function here, I'm sure you'll find it
  Reply With Quote
Old 05-27-2006, 12:34 AM   #3
Ron_dK
Cool bop aficionado
 
Ron_dK's Avatar
 
Join Date: Sep 2002
Location: France
Posts: 2,141
Thanks: 0
Thanked 4 Times in 3 Posts
Ron_dK is on a distinguished road
Computer id thru VBA :

http://www.access-programmers.co.uk/...nique+computer

__________________
.
I recognise Quality when I hear it
Ron_dK is offline   Reply With Quote
Old 05-27-2006, 01:51 AM   #4
Tsango
Registered User
 
Join Date: Mar 2006
Location: Birmingham, UK
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
Tsango has a little shameless behaviour in the past
Quote:
Originally Posted by Rich
Use the search function here, I'm sure you'll find it
I did.

I spent about 20 minutes looking but found nothing of value.

Will have another dig about....
Tsango is offline   Reply With Quote
Old 05-27-2006, 02:00 AM   #5
Rich
Guest
 
Posts: n/a
Did you follow rak's link?
  Reply With Quote
Old 05-27-2006, 03:13 AM   #6
Tsango
Registered User
 
Join Date: Mar 2006
Location: Birmingham, UK
Posts: 64
Thanks: 0
Thanked 0 Times in 0 Posts
Tsango has a little shameless behaviour in the past
Quote:
Originally Posted by Rich
Did you follow rak's link?
Yes, have had a look at it. Tried the harddrive serial number thing but it just returned "0000-0000" on all harddrives I tried it on.

Nevermind, if there is no easy way to do it, I can just produce my own unique ID for each current session

Thanks for ytour replies.
Tsango is offline   Reply With Quote
Old 05-27-2006, 07:32 AM   #7
TanisAgain
David
 
Join Date: Feb 2006
Posts: 69
Thanks: 0
Thanked 0 Times in 0 Posts
TanisAgain is on a distinguished road
Have you tried this.
Option Compare Database

'******************** Code Start **************************
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Private Declare Function apiGetComputerName Lib "kernel32" Alias _
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function fOSMachineName() As String
'Returns the computername
Dim lngLen As Long, lngX As Long
Dim strCompName As String
lngLen = 16
strCompName = String$(lngLen, 0)
lngX = apiGetComputerName(strCompName, lngLen)
If lngX <> 0 Then
fOSMachineName = Left$(strCompName, lngLen)
Else
fOSMachineName = ""
End If
End Function
'******************** Code End **************************

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function fOSUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If lngX <> 0 Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = ""
End If
End Function

TanisAgain is offline   Reply With Quote
Old 05-30-2006, 11:03 AM   #8
ghudson
Newly Registered User
 
ghudson's Avatar
 
Join Date: Jun 2002
Location: USA
Posts: 6,199
Thanks: 1
Thanked 84 Times in 48 Posts
ghudson has a spectacular aura about ghudson has a spectacular aura about ghudson has a spectacular aura about
Hard to believe that your search did not stumble upon the Environ() function. You can easily grab the users computer name and the users network name and more. I have Environ() code samples posted all over this forum.

User Logon Name or Computer ID

Unique Hard Drive Serial
__________________
.................................................. ......
Searching this forum or Microsoft.com or MSDN.com or Google is a great way to discover and learn the answers to your Access programming questions.

Well if it seems to be real, it's illusion...

I am using Access 2010 with Windows 7

The
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
function on this forum really does work.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

.................................................. ......
ghudson is offline   Reply With Quote
Old 05-30-2006, 11:15 AM   #9
garygdj
Registered User
 
Join Date: May 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
garygdj is an unknown quantity at this point
No. I did create a database that kept track of each computer and when it was logged onto. However, I sent an E-mail to all 300 employees and had them supply the number. then created a table........

In a smaller shop that may be an alternative.
garygdj is offline   Reply With Quote
Old 05-30-2006, 11:19 AM   #10
ghudson
Newly Registered User
 
ghudson's Avatar
 
Join Date: Jun 2002
Location: USA
Posts: 6,199
Thanks: 1
Thanked 84 Times in 48 Posts
ghudson has a spectacular aura about ghudson has a spectacular aura about ghudson has a spectacular aura about
What if another user signs into another users computer? What if a user changes the computer name on their PC [if they have the rights to do so on thier PCs]? What if... Too many what ifs.

I work with thousands of possible users so I know you can not trust everybody to do it the right way [so we use code to get what we want, our way].

__________________
.................................................. ......
Searching this forum or Microsoft.com or MSDN.com or Google is a great way to discover and learn the answers to your Access programming questions.

Well if it seems to be real, it's illusion...

I am using Access 2010 with Windows 7

The
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
function on this forum really does work.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

.................................................. ......
ghudson is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dll file for each computer accessing the database elliotth123 General 3 07-27-2006 12:06 PM
problem opening database on another computer marysan General 6 12-14-2004 11:52 AM
How to open a .exe file on another computer. PCandNetworking General 1 01-09-2004 11:18 AM
Getting Runtime-Error '3265' when moved to a different computer Full_Williams Reports 0 10-16-2002 11:05 AM
Way to Turn Off Computer Programically After Shutdown? llyal Modules & VBA 2 09-25-2001 08:37 AM




All times are GMT -8. The time now is 05:38 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World