Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Protect from being installed on other pc's 4

Status
Not open for further replies.

neemi

Programmer
May 14, 2002
519
GB
Has anyone come accross any code which I could place in my database to stop the database from being installed on any other computers without maybe requiring a pc secific code etc?

This is to stop reselling of applications written for companies etc.

Cheers,
Neemi
 
Hi BuiderSpec,
Thanks for taking the time to explain your code to me. It looks great and hopefully I will have some use for it in the future.
 
Thanks BuilderSpec for your help. [thumbsup2]

This is exactly what I was after. and it gives me a great building block to get started with.

It will take me a while to work through it and integrate it into my db. I am also going to create a seperate db where I can log all the Installation Keys that are given out to keep track of things.

I shall let you know how I get on.

Again thanks for your help. [thumbsup2]

Lars.... No probs with the butting in.
 
Just to throw a spanner in...

If you think about you can add more words.or more dates.. this way you could check that the current day is between two dates held in the licence..that way you can set an end date for trial periods etc using the licence key.



Hope this helps!

Regards

BuilderSpec
 
That is a good idea. Code gets more complex and would need to concentrate on it when mind is more alert though.

However also the more words you use the longer the key.

I want to try and build some sort of structure to the key which the user type in to validate the db. and maybe even the one they provide me with.

I am going to use the serial number somewhere with the code. I may even keep the two words constant and base the variation on the serial number.

When I mean structure I mean something like the microsoft keys where you have 5 blokes of 5 characters. ie 12345-12345-12345-12345-12345.

To achieve this maybe I would work out how many charcters I need to provide to key of 25 charcters.

I need to do something where on first opening it validates the software with the key which would be stored somewhere (oviously after first registering). If the key is invalid then the user is prompted to enter another one. If it is valid then they can continue.

It takes some thinking, but thanks for your help again.
The more I think about it the more I confuss myself.
But I should be alright.

Regards,
Neemi
 
Function CreateKey25(CompanyName As String, Word1 As String, Word2 As String)
Dim key As String
Dim i, j As Integer
Dim NewKey As Integer
Dim CheckDigit As Integer
Dim NewCompany As String
Dim KeyLength As Integer

NewCompany = CompanyName
NewCompany = Replace(NewCompany, " ", "")

KeyLength = Len(Word1) + Len(Word2) + 9
If Len(NewCompany) + KeyLength > 25 Then
NewCompany = Left(NewCompany, 25 - KeyLength)
End If

dt = Replace(Date, "/", "")
key = Replace(NewCompany, " ", "") & Word1 & Word2 & dt
For i = 1 To Len(key)
Mid(key, i, 1) = Chr(Asc(Mid(key, i, 1)) + 1)
Next i

CreateKey25 = key & CreateCheckDigit(key)

End Function


This function will force a 25 byte key. But considering the date plus check digit is 9 characters that only leaves 16 for the 2 words and the company name.

This routine works by trimming the company name so it is forced to create a 25 character key, if is produces a shorter one your "words" aren't long enough ...




Hope this helps!

Regards

BuilderSpec
 
Just wanted to thank Snyperx3, the get serial code, with a slight change for myself as below works great!

Code:
Function GetSerial(Optional ByVal Disp As String) As String

Dim fso As Object
Dim Drv As Object

Set fso = CreateObject("Scripting.FileSystemObject")

Set Drv = fso.GetDrive("C")

With Drv
    If .IsReady Then
        GetSerial = Abs(.SerialNumber)
    Else
        GetSerial = -1
    End If
End With

Set Drv = Nothing
Set fso = Nothing

If Disp = "Y" Then
    MsgBox "Serial : " & GetSerial
End If

End Function

I've added a switch (Disp) so you can use the routine to also display the serial if required and hardcoded it to be the "C" drive. That should stop anyone copying our DB to an unauthorised computer.

Regards,
1DMF.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top