Code to delete database if not used in 2 months

  • Thread starter Thread starter Adam
  • Start date Start date
A

Adam

Hi All,

I am looking for a code to put inside a database that deletes itself if
I have not personally opened it in 2 months.

I have a module that determines the Windows username of the person
opening the database so does anyone know of a way that I can tie this
into a code which checks the logon and deletes the database if the
timer knows that it has been more than 2 months since I logged in?

Many Thanks!
 
I can't see that you could delete the db from within itself, however, you
could delete it using an external app
Have a table that records the windows username and timestamp upon login.
Then on startup open a form the runs something like the following:

Dim ts as String
ts = DMax("timestamp","tbllogin","tbllogin!username = me")
If ts < Date() - 61 then
'Call external app to delete me
End if

hope it helps,
Regards,
Nick.
 
Hi Adam

I personally think this would be a big mistake. If a D Base needs deleting
then delete it but to set this to run a delete event after a given time is
not something I have ever seen before and I would think that as the
programmer this would not be something you should even think about.

Of course I don't know your situation but like I said - if you need to
delete a D base then there are many way that "you" can do this - BUT the main
point here is that YOU (or another "person") deletes not a programme.

You even need to code - use explorer and press delete (after backup)
 
Its a complicated situation but the jist is that I believe that someone
is taking my work and passing it off as their own on another site.
Without passwording the database prevending use etc, I would like it to
delete itself or the contents on 2 months of me not logging into it.

I think I can just setup a conditional macro linked to a delete query.
Thought there might have been a better way though.
 
Adam,
It sounds more to me like what you want is to purge data rather than to
delete your entire database. Simply create a delete query that deletes all
records that are older than 60 days (or whatever timeframe you have). Run
that query every day and you will have what you want.
 
Hi Adam
Its a complicated situation but the jist is that I believe that someone
is taking my work and passing it off as their own on another site.

I know what you mean - happens all the time (but life is too short to worry
such things)

Basically anyone who can copy your DB and get it work will normally be able
to find and remove and contional "stuff" you place.

Lynns ideas was a really good one but I assume that the people copying your
DB will not be interested in the data just the work you have put into the
development, so not really sure what you can do to stop this type of thing.
 
Its a complicated situation but the jist is that I believe that someone
is taking my work and passing it off as their own on another site.
Without passwording the database prevending use etc, I would like it to
delete itself or the contents on 2 months of me not logging into it.

I think I can just setup a conditional macro linked to a delete query.
Thought there might have been a better way though.

Unless you have database security set up, any such "firebomb" code
would be visible and could be removed by the thief. You can make code
hard to find, but it's very difficult to hide it from a determined
hacker.

Can you do a Google search for your database? Rather than having a
self-destructing database, might it not be better to track down the
offender, contact their ISP and web hoster, take legal action, expose
them in the web?


John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top