425,460 Members | 2,215 Online Need help? Post your question and get tips & solutions from a community of 425,460 IT Pros & Developers. It's quick & easy.

# Registration of software code

 P: n/a Is there some relatively simple way that I could create some sort of number from a series of letters and numbers in a field on a form and then when a person purchases the software, supply a matching number to their unique number that could be put into a field in a table that would then enable the software. I think the idea would probably work, but how do I generate the number. The number would come from something like A03078989-BT39 which is a unique serial number for one copy of the software. Just using this number would be easily guessed. How do I process the serial number to produce a unique number? Any ideas. dixie Nov 12 '05 #1
4 Replies

 P: n/a On Tue, 23 Sep 2003 09:13:28 +1000, "dixie" wrote: Here is one option: Turn the string into a number (e.g. by stripping all non-numerics). Call this number A. Then calculate the difference between that number and the number 123456789 (or any other "magic number") called number B. The user would have to enter the resulting number C (=A-B) in order to enable the software. Variants: * A is created not just by stripping the non-numerics, but these non-numerics actually modify the numerics. E.g. A adds 1, B adds 2, etc. * B is modified by the non-numerics in a similar way. * C is modified by the current date (e.g. subtract the number of days in the current year) so the code can be used only once. The sky is the limit in how complicated you can make these algorithms. Happy programming. -Tom. Is there some relatively simple way that I could create some sort of numberfrom a series of letters and numbers in a field on a form and then when aperson purchases the software, supply a matching number to their uniquenumber that could be put into a field in a table that would then enable thesoftware.I think the idea would probably work, but how do I generate the number. Thenumber would come from something like A03078989-BT39 which is a uniqueserial number for one copy of the software. Just using this number would beeasily guessed. How do I process the serial number to produce a uniquenumber?Any ideas.dixie Nov 12 '05 #2

 P: n/a Tom, could you give me an example of using VBA code for stripping non numerics out of something like A1233WB25? dixie "Tom van Stiphout" wrote in message news:8c********************************@4ax.com... On Tue, 23 Sep 2003 09:13:28 +1000, "dixie" wrote: Here is one option: Turn the string into a number (e.g. by stripping all non-numerics). Call this number A. Then calculate the difference between that number and the number 123456789 (or any other "magic number") called number B. The user would have to enter the resulting number C (=A-B) in order to enable the software. Variants: * A is created not just by stripping the non-numerics, but these non-numerics actually modify the numerics. E.g. A adds 1, B adds 2, etc. * B is modified by the non-numerics in a similar way. * C is modified by the current date (e.g. subtract the number of days in the current year) so the code can be used only once. The sky is the limit in how complicated you can make these algorithms. Happy programming. -Tom. Is there some relatively simple way that I could create some sort of numberfrom a series of letters and numbers in a field on a form and then when aperson purchases the software, supply a matching number to their uniquenumber that could be put into a field in a table that would then enable thesoftware.I think the idea would probably work, but how do I generate the number. Thenumber would come from something like A03078989-BT39 which is a uniqueserial number for one copy of the software. Just using this number would beeasily guessed. How do I process the serial number to produce a uniquenumber?Any ideas.dixie Nov 12 '05 #3

 P: n/a cinch... Option Compare Database Option Explicit Public Function JustAlpha(strAlphaNum As String) As String Dim strTemp As String Dim intCounter As Integer Dim strChar As String For intCounter = 1 To Len(strAlphaNum) strChar = Mid\$(strAlphaNum, intCounter, 1) If Not IsNumeric(strChar) Then strTemp = strTemp & strChar End If Next intCounter JustAlpha = strTemp End Function Umm... whaddaya return if it's a string of just numbers? Nov 12 '05 #4

 P: n/a On 24 Sep 2003 19:46:11 -0700, pi********@hotmail.com (Pieter Linden) wrote: Nice function - I would call it JustNumeric. At the bottom of the function I might write: if Len(strTemp)=0 then strTemp="0" -Tom. cinch...Option Compare DatabaseOption ExplicitPublic Function JustAlpha(strAlphaNum As String) As String Dim strTemp As String Dim intCounter As Integer Dim strChar As String For intCounter = 1 To Len(strAlphaNum) strChar = Mid\$(strAlphaNum, intCounter, 1) If Not IsNumeric(strChar) Then strTemp = strTemp & strChar End If Next intCounter JustAlpha = strTempEnd FunctionUmm... whaddaya return if it's a string of just numbers? Nov 12 '05 #5

### This discussion thread is closed

Replies have been disabled for this discussion. 