SetViewReadOnly()

Summary

Changes the read-only status of a view.

Syntax

SetViewReadOnly(string view_name, boolean read_only_flag)

Argument Contents
view_name The name of the view
read_only_flag Whether the view is read-only. If "False" values can be written to the view, subject to the notes appearing below.

Note

  • If view_name is null, SetViewReadOnly() changes the current view.

  • If the view is a dBASE, comma-separated text, fixed-format text or fixed-format binary table, SetViewReadOnly() closes and reopens the necessary files if there is a change of read-only status.

  • For other views SetViewReadOnly() marks the view as read-only but does not reopen any files.

  • If the view is a joined view, SetViewReadOnly() does not affect the read-only status of component views.

Example

SetViewReadOnly("Customers", "True")

Error Codes

Error Type Meaning
Error Some necessary files cannot be opened in the specified mode, e.g., a user without write access to a file tries to open that file in a non-read-only mode
NotFound The input view does not exist, or the input view is null and there is no current view

See Also

Function Summary
GetViewReadOnly() Reports whether a view is read-only