HI TC,
I must say that I feel very "STUPID" and I should of
thought about the Open statement. I must say that it
worked like a charm. This is a command that I don't use
often in Access but used to use it in my hay days when
programming in Basic within DOS was the in thing.
The Idea behind my question is that I give out my Access
application software to my employees so that they can
learn it on their spare time, however, after they open my
forms more than x times, I want the application to bomb,
and thats what I was able to accomplished this weekend
thanks to you. You see, I personally have put alot of
hard work in this application and would like to protect
it.
Its really neat, because, I have created a table called
Timebomb and stored 2 fields in it. An integer field to
keep track of the count(# of times a form is opened) and
a text field (For password purposes).
When my forms open and the password is correct, the form
opens without counting. However, before I give out a copy
to someone, I change the Password field to anything else
but the password my code looks for. I then make an MDE
file out of it and give it out. Now when a form opens, it
sees the wrong password and starts to count.
Once the target count has been attained, a timebomb file
is created and an IF statement sends the program
execution to a message indicating an error and bombs.
Here is the solution to your comment. Even if someone
kills the data base, and a new one is re-loaded and the
timebomb file is still present the re-loaded software
will detect an active timebomb file and ofcourse at this
point the application will bomb and the user can't use
the database. However, this was what I wanted. You may
ask yourself, "So then how can I get the user to cancel
the timebomb file so he can continue using the software.
Well, the user will call me, and if I believe he should
be able to continue using the software, I ask him to go
at a form called options, request that he clicks on
a "Reset timebomb" button, where an input box shows up.
I will tell him a code to enter based on a mathematical
formula involving the date. Access will recognize the
code and delete the timebomb file and reset the count
field to 0. However this does not cancel the time bomb,
it just lets the user go on for a few more times.
I really appreciate your help and probably what I did was
not the absolute best solution however I got to doing
what I needed thanks to your help. You see this is the
first time I use this type of support and I am glad that
programmers can help each other. Right after you helped
me, I answered a question that was posted. As the saying
goes "Why not help someone when you have been help by
others!"
Best Regards
Robert.
-----Original Message-----
Ouch! Why go to the complication of creating a
database< just for that
purpose? Just create a normal file, using the VBA [file] Open statement.
But, all such scehemes have the following fatal flaw. If your database dies
(or is killed by the user) without deleting the signal file, everything goes
wrong from then after. How does your code know that the signal file is now
an orphan, & should be ignored?
HTH,
TC
Robert said:
I would like to create a new database on my hard disk
from within a current one. I would like to be able to
create it in a subdirectory of my choice ex:
C:\MyDocuments.
A few exmples are available in Access 2002 help, however
they pretty much all use DAO. I'm looking for a code
fragment in ADO. However this must be done through a
macro or VBA code(ADO).
My intent is to flag the computer that opened my database
by creating a new database in a subdirectory. This way on
opening of my database I would know if it was previously
opened or not.
Can someone help!
.