KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: The READ WRITE Command
PRODUCT: 4D | VERSION: | PLATFORM:
Published On: November 5, 1999

The READ WRITE command puts the table in a state that allows you to read and modify records. Records for that table can be loaded and locked to other users or processes. If a record is loaded in read/write mode, you can make changes to the records. The table must be in a read/write state for a record to be loaded unlocked.

When you first open a database or process all tables are in a read/write state and the command does not have to be used. Thus, the command READ WRITE is used to set the state of a table to read/write that was previously set to read only using the command READ ONLY .

When a table is read/write and a record is loaded, the record will be loaded unlocked if no other user has locked the record first.

This command changes the status for the next loaded record. Once a record is loaded in a read-only state it cannot be changed to a read-write state. In order to access that record in a read-write state, the record must be unloaded, READ WRITE must be executed to set the table to read-write, and then the record must be reloaded. Providing that the record has not been loaded and locked by any other user or process, the record will now be unlocked. This means that you cannot have a button on an input form that simply calls READ WRITE to change the status of the current record.