GetTableModifyFlag()

Summary

Tests whether a table can be modified by ModifyTable().

Syntax

flag = GetTableModifyFlag(string view_name)

Argument Contents
view_name Name of a view, or null for the current view

Returns

The string "True" if the table can be modified by ModifyTable(), or a string that describes why the table cannot be modified.

Notes

  • GetTableModifyFlag() tests the table according to three criteria:

    • It must not be read-only.

    • It must be a dBASE, fixed-format text, or fixed-format binary table.

    • It must not be part of any joined view.

  • GetTableModifyFlag() returns "True" if all three conditions are met, even though a call to ModifyTable() might still fail for other reasons (e.g., the user does not have file access, some files are in use by other users, or there is not enough disk space).

Example

test = GetTableModifyFlag("Employees")
if Upper(test) = "TRUE" then ShowMessage("The table can be modified")
else ShowMessage("The table cannot be modified: " + test)

Error Codes

Error Type Meaning
NotFound The named view does not exist, or view_name is null and there is no current view

See Also

Function Summary
ModifyTable() Modifies the file structure of a dBASE, fixed-format text or fixed-format binary table
GetViewReadOnly() Reports whether a view is read-only
SetViewReadOnly() Changes the read-only status of a view
GetViewTableInfo() Gets information about a table