Licence?

  • Thread starter Thread starter David Kennedy
  • Start date Start date
D

David Kennedy

Hi,

I am creating an access database to keep employee details and track
employee issues on various work sites.
This database is intended to be used by only one person using a laptop.
Is there a way to prevent this database from been copied and used on other
computers?
ie some kind of licencing. I was thinking of writing code using the computer
name as a measure to do this?
Im not sure how to go about it,maybe Im going in the wrong direction. does
anyone have any ideas?

Thanks
david
 
Hi

You cannot really stop someone copying and pasteing the db elsewhere.
You could have a function run at startup to check for machine name and
pc logon name etc and then exit the db etc. Bear in mind there are
many ways around this such as changing the computer name/logon name
etc

Option Compare Database
Option Explicit

' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Private Declare Function apiGetComputerName Lib "kernel32" Alias _
"GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As
Long

Function fOSMachineName() As String
'Returns the computername
Dim lngLen As Long, lngX As Long
Dim strCompName As String
lngLen = 16
strCompName = String$(lngLen, 0)
lngX = apiGetComputerName(strCompName, lngLen)
If lngX <> 0 Then
fOSMachineName = Left$(strCompName, lngLen)
Else
fOSMachineName = ""
End If
End Function


Declare Function WNetGetUser Lib "mpr.dll" _
Alias "WNetGetUserA" (ByVal lpName As String, _
ByVal lpUserName As String, lpnLength As Long) As Long

Const NoError = 0 'The Function call was successful

Function GetUserName() As String

Dim LUserName As String
Const lpnLength As Integer = 255
Dim Status As Integer
Dim lpName

' Assign the buffer size constant to lpUserName.
LUserName = Space$(lpnLength + 1)

' Get the log-on name of the person using product.
Status = WNetGetUser(lpName, LUserName, lpnLength)

' See whether error occurred.
If Status = NoError Then
' This line removes the null character. Strings in C are
null-
' terminated. Strings in Visual Basic are not null-
terminated.
' The null character must be removed from the C strings to
be used
' cleanly in Visual Basic.
LUserName = Left$(LUserName, InStr(LUserName, Chr(0)) - 1)

Else
' An error occurred.
MsgBox "Unable to get the name."
End
End If

GetUserName = LUserName

End Function
 
YES YOU CAN prevent someone from copying and pasting the database

the answer is Access Data Projects, kid
 
Susie DBA said:
YES YOU CAN prevent someone from copying and pasting the database

the answer is Access Data Projects, kid

Note that this person is really A a r o n K e m p f and that he is not an employee
of Microsoft.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
Tony

**** you, I never claimed to be an employee of Microsoft.


I care too much about quality to work for an abusive company like MS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top