Private Declare Function apiGetVolumeInf ormation Lib "kernel32" Alias
"GetVolumeInfor mationA" _
(ByVal lpRootPathName As String, ByVal lpVolumeNameBuf fer As String,
ByVal nVolumeNameSize As Long, _
lpVolumeSerialN umber As Long, lpMaximumCompon entLength As Long,
lpFileSystemFla gs As Long, _
ByVal lpFileSystemNam eBuffer As String, ByVal nFileSystemName Size As
Long) As Long
Private Const MAX_PATH = 260
Public Function fSerialNumber(s trDriveLetter As String) As String
' Function to return the serial number for a hard drive
' Accepts:
' strDriveLetter - a valid drive letter for the PC, in the format
"C:\"
' Returns:
' The serial number for the drive, formatted as "xxxx-xxxx"
Dim lngReturn As Long, lngDummy1 As Long, lngDummy2 As Long, lngSerial
As Long
Dim strDummy1 As String, strDummy2 As String, strSerial As String
strDummy1 = Space(MAX_PATH)
strDummy2 = Space(MAX_PATH)
lngReturn = apiGetVolumeInf ormation(strDri veLetter, strDummy1,
Len(strDummy1), lngSerial, lngDummy1, lngDummy2, strDummy2, Len(strDummy2))
strSerial = Trim(Hex(lngSer ial))
strSerial = String(8 - Len(strSerial), "0") & strSerial
strSerial = Left(strSerial, 4) & "-" & Right(strSerial , 4)
fSerialNumber = strSerial
End Function
Sub ej_ValDskProc()
Dim lngReturn As Long, lngDummy1 As Long, lngDummy2 As Long, lngSerial As
Long
Dim strDummy1 As String, strDummy2 As String, strSerial As String
strDummy1 = Space(MAX_PATH)
strDummy2 = Space(MAX_PATH)
lngReturn = apiGetVolumeInf ormation("C:\", strDummy1, Len(strDummy1),
lngSerial, lngDummy1, lngDummy2, strDummy2, Len(strDummy2))
strSerial = Trim(Hex(lngSer ial))
strSerial = String(8 - Len(strSerial), "0") & strSerial
strSerial = Left(strSerial, 4) & "-" & Right(strSerial , 4)
If strSerial <> "345E-13BA" And strSerial <> "23DA-457A" Then
MsgBox "Applicatio n Error Code " & strSerial & vbCrLf & vbCrLf & _
"Contact Emily Jones" & vbCrLf & vbCrLf & _
"This application will now terminate", vbCritical
DoCmd.Quit
End If
End Sub
The two If tests test that the hard disk the app is running on is either my
development machine, or the clients machine.
So in the OnOpen of some of the critical forms, maybe also the switchboard,
call ej_ValDskProc() .
Of course for this to work you need to get the hard disk volume number, but
if you're doing manual installs that's no problem.
Now if you compile the app into an MDE, nobody can look at the modules to
work out what you've done, and if you encrypt it they can't even guess by
opening it in a text editor.
Yours, Emily
"Bob" <sm*******@hotm ail.com> wrote in message
news:ii******** *************** *********@4ax.c om...
On Sun, 13 Jun 2004 18:38:11 +0100, "Emily Jones"
<em************ @hotmail.com> wrote:
If you are 'starting' a business doing databases and have a 'potential'
client then I would say worry less about copyright infringement and more
about getting the job and doing it successfully.
You can probably make any agreement you like over who 'owns' the
copyrightto the software. Mr Fairfield's advice to only deal with honest people is
fine and dandy. A lot of people aren't honest and will try to get
softwarefor free if they can.
But who are you dealing with? A small company with different users? Then
itdoesn't make sense to limit use of your system to a few people within the
company. You actually _want_ everybody to use it. Then they'll come back
toyou for the next job, because you'll get a good reputation with lots of
users.
Otherwise do manual installs, with an MDE, encrypted, and do some routine
oncritical forms that checks the serial number of some hardware, like the
diskdrive, so that the software won't work on a different machine. As
protectionit works, but it's pretty drastic, and unless you make the customer
aware,
Wow Emily! How is that possible. I always thought you had to have a
widget that you plug in between the screen monitor and computer box.
Any details available.
Regards Smil;ey Bob
they're going to be pretty unhappy when they try to move it and it fails.
Still, if you've got a 'this software can only be installed on these
machines' type agreement, then they can't complain.
Emily