Solved

Identify Unique Thin Client In Access with VB

Posted on 2013-01-16
5
492 Views
Last Modified: 2013-01-16
I am trying to use VB in MS Access to find a way to find a unique identifier of a thin client.  I use this to discretely identiry who may have performed a particular action in the database.  In the past, I have used

shell:
Dim objShell: Set objShell = CreateObject("Wscript.Shell")
strPC = objShell.ExpandEnvironmentStrings("%computername%")

on other projects.  However, this returns the name of the server.

Is there a way to find somehting unique to the thin client?  Session ID?  Motherboard serial number.  Thin client serial number?

Any help would be appreciated.
0
Comment
Question by:Scamquist
5 Comments
 
LVL 9

Accepted Solution

by:
TazDevil1674 earned 500 total points
Comment Utility
Change %computername% to %clientname%

strPC = objShell.ExpandEnvironmentStrings("%clientname%")
0
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
Why not the user name?

Jim.

Private Declare Function GetComputerNameA Lib "kernel32" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function GetUserNameA Lib "advapi32.dll" (ByVal lpBuffer As String, nSize As Long) As Long

Public Function WhoAmI(bReturnUserName As Boolean) As String

        ' Function returns either user name or computer name

        Dim strName As String * 255

10      If bReturnUserName = True Then
20        GetUserNameA strName, Len(strName)
30      Else
40        GetComputerNameA strName, Len(strName)
50      End If

60      WhoAmI = left$(strName, InStr(strName, vbNullChar) - 1)

End Function
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
strClient = objShell.ExpandEnvironmentStrings("%username%")
0
 
LVL 1

Author Comment

by:Scamquist
Comment Utility
This is on the manufacturing floor and all have the same user name, eproduction.user.  

I have incorporated user name in the past and it works well.


However, TAZ

strPC = objShell.ExpandEnvironmentStrings("%clientname%")

worked like a champ.

Thanks
0
 
LVL 1

Author Closing Comment

by:Scamquist
Comment Utility
Quick and Easy...

THANK YOU!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now