I want to make sure that nothing can be accidentally altered.
How do you "accidentally" alter something in a program? If your program alters the data it's on purpose, not by accident. Want read-only? Just make sure your program doesn't attempt to alter the data.
Ancient Dragon
Achieved Level 70
32,123 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 69
I think he is running the UPDATE to test if he has opened Access in Read Only mode.
As Ancient Dragon says, the data will only be altered if you run an UPDATE, INSERT or DELETE query so don't!
G_Waddell
Practically a Master Poster
619 posts since Nov 2009
Reputation Points: 107
Solved Threads: 92
Skill Endorsements: 5
I believe that the OP's reasoning may be valid if another application is accessing the DB as well. If both tried to grab total access at the same time, there may be a conflict.
Assuming that you made a typo on the forum (missing opening quote) with the connection string, the second version (Mode=Read;) should prevent you from executing insert/update commands. And yes, I have verified that it blocks writing; it throws an invalid update command when executing.
TnTinMN
Practically a Master Poster
640 posts since Jun 2012
Reputation Points: 418
Solved Threads: 148
Skill Endorsements: 13
But that won't prevent other programs from updating the data. The database server locks tables when doing updates, there is nothing you need to put in your code to do that.
Ancient Dragon
Achieved Level 70
32,123 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 69
Question Answered as of 3 Months Ago by
Ancient Dragon,
G_Waddell,
azareth
and 1 other
Tables don't get modified by accident, you have to intentially do it.
Ancient Dragon
Achieved Level 70
32,123 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,575
Skill Endorsements: 69