?
Solved

Identify Unique Thin Client In Access with VB

Posted on 2013-01-16
5
Medium Priority
?
504 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
[X]
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
5 Comments
 
LVL 9

Accepted Solution

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

strPC = objShell.ExpandEnvironmentStrings("%clientname%")
0
 
LVL 58
ID: 38783233
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 120

Expert Comment

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

Author Comment

by:Scamquist
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.

Thanks
0
 
LVL 1

Author Closing Comment

by:Scamquist
ID: 38783618
Quick and Easy...

THANK YOU!
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
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 …
Suggested Courses

765 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