Kin Kam said:
I was wondering if you any of you can help me. I've designed a database in
Access 97, and I am concerned that someone else would "promote" it as their
own. Is there any way of putting in a secret - much like an Easter Egg - or
anything equivalent so in the case of ownership issues I can press a few
buttons and it then pops up my name!!
I use a custom database property named "Copyright" which is not visible, but
can be called from code. Put the following code in a standard module, change
my name to yours and run the code CreateC and UpdateC from the debug window.
Then delete the module. Putting the code back in a new module and running
GetCopyright will produce the text:
Portions of this application use code which was copyrighted by, and remains
the property of, Arvin Meyer ©1995-2003
---------------Begin Code----------------------
Option Compare Database
Option Explicit
Sub CreateC()
On Err GoTo Err_Handler
Dim db As DAO.Database
'Set db = OpenDatabase("C:\FullPathToFile.mdb")
Set db = CurrentDb
db.Properties.Append db.CreateProperty("Copyright", dbText, 123)
Exit_Here:
Set db = Nothing
Exit Sub
Err_Handler:
MsgBox Err.Number & ": " & Err.Description
Resume Exit_Here
End Sub
Sub UpdateC()
Dim db As DAO.Database
'Set db = OpenDatabase("C:\FullPathToFile.mdb")
Set db = CurrentDb
db.Properties("Copyright").Value = "Portions of this application use code
which was copyrighted by, and remains the property of, Arvin Meyer
©1995-2003"
Set db = Nothing
End Sub
Function GetCopyright()
Dim db As DAO.Database
'Set db = OpenDatabase("C:\FullPathToFile.mdb")
Set db = CurrentDb
GetCopyright = db.Properties("Copyright").Value
Set db = Nothing
End Function
---------End Code-----------------
The custom property will live with the database, and all copies of it. It
will not survive if all objects are copied to a new, empty database.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access