Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Identify Unique Thin Client In Access with VB

Posted on 2013-01-16
Medium Priority
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

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.
Question by:Scamquist
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

TazDevil1674 earned 2000 total points
ID: 38783180
Change %computername% to %clientname%

strPC = objShell.ExpandEnvironmentStrings("%clientname%")
LVL 58
ID: 38783233
Why not the user name?


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
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38783267
strClient = objShell.ExpandEnvironmentStrings("%username%")

Author Comment

ID: 38783616
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.


Author Closing Comment

ID: 38783618
Quick and Easy...


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a serious pitfall that can happen when deleting shapes using VBA.
This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

604 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