Jibbadiah
James
- Local time
- Tomorrow, 07:35
- Joined
- May 19, 2005
- Messages
- 282
Gents/Ladies,
I have created a database with an "on-open" function that creates a temporary directory and certain program files on the local drive of a users pc. This directory is used for FTP and archiving of sensitive customer data, so when the database is closed it runs code that deletes all files on exit.
This functionalty works fine - however I am a total numpty
, and I regularly open multiple sessions of the same database - (because it has loads of cool but totally different functionality). If I close one version I inadvertently remove all files that the other session may want to use.
I realise that you can use the following useful code:
If Len(Dir(<filename>)) > 0 Then Blah blah {Checks file existence}
If FileLen(<filename>) = 0 Then blah blah {Ensures file isn't zero bytes}
Hence I can check that .ldb exists etc... But can I check that the same database is open twice by the same person before I allow the script to delete files?
Cheers,
James
I have created a database with an "on-open" function that creates a temporary directory and certain program files on the local drive of a users pc. This directory is used for FTP and archiving of sensitive customer data, so when the database is closed it runs code that deletes all files on exit.
This functionalty works fine - however I am a total numpty

I realise that you can use the following useful code:
If Len(Dir(<filename>)) > 0 Then Blah blah {Checks file existence}
If FileLen(<filename>) = 0 Then blah blah {Ensures file isn't zero bytes}
Hence I can check that .ldb exists etc... But can I check that the same database is open twice by the same person before I allow the script to delete files?
Cheers,
James