PDA

Click to See Complete Forum and Search --> : Toggling the Read-only attribute on an Access DB file.


jay_seese
Aug 31st, 2000, 07:13 PM
I don't have any idea where to start to access system file objects and change their property attributes. Using ADO, I am reading data from an Access DB file. Immediately after the read, I want to lock the database (ie change its property attribute to read-only) so others cannot make changes to the database while my program processes the data.
When the data is computed, I would like to return the database to its default state of read-write.

I'm guessing this is very difficult, but trying to find this info in the MSDN Library is like looking for a needle in a haystack.

Please help.

Thanks,
~J

JHausmann
Aug 31st, 2000, 07:32 PM
Seems to me you could accomplish the same effect by "renaming" the database. Another program tries to open it and it won't be there....

jay_seese
Aug 31st, 2000, 08:43 PM
The database name need to be intact. Another program should be able to read the data, but not write.

jay_seese
Sep 1st, 2000, 04:13 PM
I understand that my program will be affected too. Here is the flow:

open DB
read record info into variables
lock DB (so no changes can be made)
process info (which due to networking could be slow for a computer- I want to be certain that nothing changes in the database while my program processes.)
when processes have been completed with no error, then
unlock DB
write new info
read next record


What I want is a code sample that shows me how to access a system file object and change its property attributes through code. I'm sure this is very simple.. otherwise windows developers should be slapped. I just can't seem to find the info.

Thanks,
~J