Private Sub frmMain_Unload()

ZeligOn
04-25-2003, 01:17 PM
Hello all,

Is it possible to write into the DB when the app' ends
even if the PC crash or the user "kill" the app' (alt+ctrl+del)

Thanks,
Eddie.

Iceplug
04-25-2003, 01:24 PM
You'll have the best chance of catching that in the Form_Unload (not frmMain_Unload) event or the Form_QueryUnload event.
Although, by definition, you can't do anything after a crash (:-\), except backup.

ZeligOn
04-28-2003, 01:52 PM
You'll have the best chance of catching that in the Form_Unload (not frmMain_Unload) event or the Form_QueryUnload event.
Although, by definition, you can't do anything after a crash (:-\), except backup.
So, does it mean that I should make a dll that runs when the
PC boot up and check if the command was executed ?

Iceplug
04-28-2003, 02:10 PM
Just add the final touches to your database in the Form_Unload event.
The only way to protect against the crash is to have a backup file.
I don't understand why you'd need a DLL.

3D-Reality
04-28-2003, 04:02 PM
Erm.... add an entry to an ini on propper close (1)..... when the program runs add (0)..... if the program has crashed then the ini will remain as 0.......... if you backup regularly, it will be easy to restore where left of ;-)

ZeligOn
04-28-2003, 04:19 PM
Erm.... add an entry to an ini on propper close (1)..... when the program runs add (0)..... if the program has crashed then the ini will remain as 0.......... if you backup regularly, it will be easy to restore where left of ;-)
What if the user change the ini ?

ZeligOn
04-28-2003, 04:28 PM
Just add the final touches to your database in the Form_Unload event.
The only way to protect against the crash is to have a backup file.
I don't understand why you'd need a DLL.
I'm trying to make a secure DB by
installing an encrypt DB with the app',
when the app' is running first thing is to decrypt the DB
then open a connection, when the user is closing the app'
I want to encrypt back the DB and delete the decryption file,
all the problems starts when the PC crash or . . . (didn't think about that)

YuanHao
04-28-2003, 04:30 PM
Hmm.... Use OnError Goto BackupProcess something like that.
And for encryption, go to the Tutorīs corner.

3D-Reality
04-28-2003, 04:48 PM
Err? If the pc crashes the db closes so all u gotta worry about is your prog crashing?

ZeligOn
04-28-2003, 04:55 PM
Err? If the pc crashes the db closes so all u gotta worry about is your prog crashing?
If the PC crashes so my app' will crash as well,
that's why I need a dll when the os boot up
I need to check if the decrypted DB is exist,
if so to encrypt it and then delete it.

Banjo
04-28-2003, 06:46 PM
Why not just write a value to the registry when your app starts and delete it when it closes.

That way you can simply check for the presence of that value in the registry on startup. If its there then your app did not close correctly the last time it was run.

ZeligOn
04-29-2003, 03:32 PM
Why not just write a value to the registry when your app starts and delete it when it closes.

That way you can simply check for the presence of that value in the registry on startup. If its there then your app did not close correctly the last time it was run.


That's what I'll do, thanks.

Is this modul is approved for the job ?
I never write to registry before so any tip will be helpful.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum