Help with a piece of code

Enesto

New member
Local time
Today, 20:50
Joined
Apr 21, 2007
Messages
7
Hello all!

I am building a database in msacces and i want to sell it when its ready. Now to prevent copying i want to build in an activation procedure. For that procedure i am looking for a piece of script that will generate a computer specific number. So for every pc the database is put on, an other number will be generated. But the generared number must always be the same for one computer.

I think i must readout something unique on the pc and translate that into a code. I thought about getting the volumename of the C-drive but that is after windows installation always the same, so it wil generate on multiple pc's the same number. And I don't know how and what to get on the pc that makes a computer unique... well know i think of it.. perhaps an mac-adress of a component.. but how do i get it?????
 
There is a posting somewhere on this forum containing a function called 'GetIPAddress'. You could call this to identify the specific PC then increment a number and append it to the address.

I just did a quick search for the function, but can't find it. Hopefully you'll have more luck.
 
IP address is the wrong way to go. Most IP addresses are not static and thus will change and be reused over time. You were correct to assume the MAC Address, which is unique for each computer. However, the best way to go would be to use registry keys and base the program on the Windows/Linux/OS registration.
 
There is a posting somewhere on this forum containing a function called 'GetIPAddress'
might cause problems in a DHCP environment though.

A quick google on "VBA Mac address" does yield a function in VB, but it needs some work to operate correctly in VBA which I don't have time to investigate at the moment.
http://www.osix.net/modules/article/?id=2
 
I am still thinking that you do not want either the MAC address or the IP address. Both are networking addresses that may change over time. For instance, whenever a person gets a new network card (or wireless adapter) the MAC address will change. IP addresses are generally controlled by internet service providers (ISPs) and until IPv6 becomes standardized and used by everyone, everyone will more than likely be sharing and renewing IP addresses.

What you want is to have one copy of your software per computer, but you shouldn't just think of your computer as a physical object. Otherwise, all a person needs to do is switch his network adapter during installs and voila, he can copy your software to any number of computers - easy to change adapters with the USB Fingerdrive Wireless Adapters.

While MAC address is your most static identifier, you should also include OS info, in case someone does upgrade their internet hardware, or installs the same OS on another computer (Win98 baby!). However, for information on VB and MAC Addresses, see http://www.codeguru.com/vb/gen/vb_system/network/article.php/c10887/

As noted in the article, the method you use to retrieve the address could affect the information you receive. Some methods only retrieve information about network cards that are enabled, some only get information for those that are plugged in, while the others may retrieve info from all cards, plugged in or not.
 
Misschien is dan het bios serienummer een beter idee. Bedoel wat hier boven staat over wisselen van netwerkkaart is natuurlijk errug waar.

Maar vraag me helaaaaal niet hoe ik het bios serienummer in een string krijg.

Misschien is het veeel gevraagd, maar mag ik een beroep doen op jullie wijsheid om een stukje script te schrijven wat ik kan copy-pasten in een module?
 
You could retrieve the ComputerName with the Environ() function but the computer name can be changed as well.
 
Got it!!!! I used a simple script to retrieve the HDD serialnumber, i've put the serialnumber in an algoritm and bingo :)

Thank you all very much!!!
 
HDD is not a good way to go either. Hope you're grabbing the default HD, since many computers these days are using multiple drives, but now what happens when someone wants to upgrade their HD? They're allowed to install on the new one, or no?

If they are.. then that'd be the same as installing on another computer entirely. You need a combination of retrieving system devices and operating system serial numbers (much like what Microsoft did for Windows XP). If more than two things change then the computer is a "different computer" and the user must call in for activation of the software.
 
You're right (again) got a suggestion how to get the windows serial number?
 

Users who are viewing this thread

Back
Top Bottom