Results 1 to 4 of 4

Thread: Toggling the Read-only attribute on an Access DB file.

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    3

    Question

    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

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    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....

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    3

    Post

    The database name need to be intact. Another program should be able to read the data, but not write.


  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    3

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width