Hi, Nhan.
I have created a MDE. In this MDE I have some important functions, methods,
which I don't want, that another user, developer can see and use them, when
they make a reference to this MDE. How can I do this?
If Alex's suggestion doesn't work, then you still have a few options to
protect your code.
To hide these procedures, declare them as private, or place them in form
modules or class modules, none of which are "exposed."
If you truly must make a procedure public in a regular module, then add an
extra parameter with a string data type. This parameter, no matter what you
name it, is the password. Place code within the procedure that checks this
password. If it's incorrect, then display a message that tells the user
"You are not authorized to use this procedure. Please contact Nhan to
purchase the source code." Then exit the procedure. Your own code that
calls this procedure passes the correct password, so it will easily bypass
this gate guard. Make sure you use a strong password, with at least nine
alphanumeric and special characters.
Add a static variable as a counter in this procedure that counts the number
of times the procedure is called (it doesn't matter whether the procedure is
successfully executed or not). After a sufficiently high number of times
(perhaps 400 - 800 times), display the message that the user is not
authorized to use the procedure and automatically exit the procedure, even
if the password _is_ correct. This lets a legitimate user of your
application keep the application open for days or weeks at a time and not
encounter the message, yet prevents someone using brute force attempts from
eventually discovering the password.
Of course, this adds administrative maintenance to the application, but if
none of the other options to hide the public procedures are available, then
you can still prevent others from using your procedures without your
permission. The name of the public procedure will be visible, as well as
the parameters, but the procedure will be essentially useless to others.
Whatever you do, don't lose that MDB file. Make several backups, just in
case.
HTH.
Gunny
See
http://www.QBuilt.com for all your database needs.
See
http://www.Access.QBuilt.com for Microsoft Access tips.
(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)