Restrict use of Access to one computer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

G'day everyone

Is it possible to restrict a MS database so it can only run on a particular
computer &/or system?
I want to stop people from copying the database onto another system and
using it there.

Thanks

Logi
 
Then you have to find some value that uniquely identifies a single PC.

Oops! No such value, sorry!

People sometimes try:

- the hard disk serial number: but they get this using the win32
GetVolumeSerialNumber API. That returns the *volume* serial number - a
completely different thing.

- the CPU serial number: gone, but not forgotten :-)

- the windows product ID - you can get this from the registry (thru
code);

- BIOS details (date etc.) - also gettable from the registry;

- etc. and/or combinations thereof.

IOW there is no easy solution.

HTH,
TC
 
TC said:
Then you have to find some value that uniquely identifies a single PC.

Oops! No such value, sorry!

People sometimes try:

- the hard disk serial number: but they get this using the win32
GetVolumeSerialNumber API. That returns the *volume* serial number - a
completely different thing.

- the CPU serial number: gone, but not forgotten :-)

- the windows product ID - you can get this from the registry (thru
code);

- BIOS details (date etc.) - also gettable from the registry;

- etc. and/or combinations thereof.

IOW there is no easy solution.

HTH,
TC

Hi there,

I beg to differ a little:
If your computer has a network card, this will contain the MAC address,
which is supposed to be unique.

The Windows GUID is supposed to be different on each machine as well.
(AFAIK the network adapter's MAC address is used for its generation -if
present, that is. If not, a random value is used..)


You can read the Windows GUID by declaring a function
GetCurrentHWProfile along with its return type and calling this:


Private Const HW_PROFILE_GUIDLEN = 39
Private Const MAX_PROFILE_LEN = 80

Private Type HW_PROFILE_INFO
dwDockInfo As Long
szHwProfileGuid As String * HW_PROFILE_GUIDLEN
szHwProfileName As String * MAX_PROFILE_LEN
End Type

Private Declare Function GetCurrentHWProfile Lib "advapi32.dll" Alias
"GetCurrentHwProfileA" (ByRef HwProfileInfo As HW_PROFILE_INFO) As Long

Function PBMAIN()
Dim lHWProfile As HW_PROFILE_INFO
Dim dummy As Long

dummy = GetCurrentHWProfile(lHWProfile)
MsgBox "GUID: " & lHWProfile.szHwProfileGuid
Debug.Print "GUID: " & lHWProfile.szHwProfileGuid
End Function



Hope that helps,

Joerg
 
Not sure I can accept the MAC, cos not all PCs have a network card :-)

I didn't know about the Windows GUID. Thanks for that info, I'll look
at it further.

I know that in some corporate installations, the Windows /Product ID/
is identical on all PCs. Would the GUID be different?

Cheers,
TC
 
I doubt you'll have much joy in using the computer name. That is not a
unique value.

If you want a single value, you'd be better off using the windows
product ID, or perhaps the windows GUID which Joerg has described.

HTH,
TC
 
TC wrote:
...
I didn't know about the Windows GUID. Thanks for that info, I'll look
at it further.
You're welcome.. ;-)
I know that in some corporate installations, the Windows /Product ID/
is identical on all PCs. Would the GUID be different?
Hmm.. quite frankly, I don't know. I strongly suspect that it _is_
indeed different, but I have never tested it myself.
Cheers,
TC

Regards,

Joerg
 
Um, Joerg, GetCurrentHwProfile retrieves a GUID for the current
hardware profile - not for the PC as a whole. There might be many
hardware propfiles on the same PC. Therefore, GetCurrentHwProfile could
return many GUIDs - not just one - on a single PC.

I can't see any way to use that function to identify a single PC. If
you just use the /current/ profile, the identification fails if the
user selects a different profile. And if you try to use /all/ profiles
- perhaps concatenating all those GUIDs - the method fails if the user
adds a new profile, or deletes an existing one.

Also not available on win9x, afaics :-(

Cheers,
TC
 
TC said:
Um, Joerg, GetCurrentHwProfile retrieves a GUID for the current
hardware profile - not for the PC as a whole. There might be many
hardware propfiles on the same PC. Therefore, GetCurrentHwProfile could
return many GUIDs - not just one - on a single PC.

I can't see any way to use that function to identify a single PC. If
you just use the /current/ profile, the identification fails if the
user selects a different profile. And if you try to use /all/ profiles
- perhaps concatenating all those GUIDs - the method fails if the user
adds a new profile, or deletes an existing one.

Also not available on win9x, afaics :-(

Cheers,
TC

Hi TC,

thanks.. learned something again.

That's the problem about programming for computer-abecedarians.. You
don't have to care about most of the things you can do with your
computer, because they won't do that anyway.. But woe betide you if
someone should use something you haven't foreseen.. :-/


Joerg
 
Back
Top