Identifying hardware

dsigner

Registered User.
Local time
Today, 21:33
Joined
Jun 9, 2006
Messages
68
Can anyone tell me the easiest way of identifying which computer an Access database is running on. I have a demo database on portable media and need to be able to tell if it is running on one of my (3) computers or on someone elses.
 
You could always use something like this:
Code:
General Declarations
Public blnDemo As Boolean
Code:
Dim strCompName As String

strCompName = Environ("computername")

Select Case strCompName
Case "Your1stComputerName", "Your2ndComputerName", "Your3rdComputerName"
   blnDemo = False
Case Else
   blnDemo = True
End Select

And then just set whatever based on the boolean value
 
This structure looks like just the thing but don't I have to put something into environ("computername") for it to work? At the moment it just returns an empty string. I looked at the Access help files for environ and they seemed to be the right sort of place but could not find out how to get a string into it.

Sorry to be dim but I haven't had the need to play about with system variables much.
 
Still can't actually get computer name out of environ.
Decided to solve it my putting a text file on C: drive of all my machines with info which Access needs about the system. Clearly any computer without such a file is a demo.

Thanks for your help. The Environ function is a great addition to my knowledge and will help with other things.
 

Users who are viewing this thread

Back
Top Bottom