RenameTableFiles()

Summary

Renames all files associated with a table or view.

Syntax

RenameTableFiles(string view_name, string class, string primary, string secondary, string new_primary, string new_secondary)

Argument Contents
table_name Name of input view, or null. If this value is not null, the next three arguments are ignored
class Class of input table: "FFA", "FFB", "CSV" or "dBASE"
primary Primary filename for input table
secondary Secondary filename for input table
new_primary New primary filename; must be a valid filename
new_secondary New secondary filename; can be null

Notes

  • The file types include FFA for fixed-format text (ASCII), FFB for fixed-format binary, and CSV for comma-separated text (values).

  • If the input view_name is provided, the table referenced by input_view is renamed.

  • If view_name is null, the input table is determined by the class, primary, and secondary arguments.

  • If the first four arguments are all null, RenameTableFiles() renames the table files for the current view.

  • RenameTableFiles() renames all data files, dictionary files, and index files associated with the input table.

  • The new_primary argument cannot be null. If the new_secondary argument is null, the new dictionary and index files have default filenames.

  • RenameTableFiles() can be used on an open table.

  • Use RenameDatabase() to rename the files that make up a geographic file.

Example

RenameTableFiles("U.S. States", , , , "newstate.dbf", )
RenameTableFiles(, "DBASE", "c:\\mydata.dbf", , "yourdata.dbf", "yourndex.mdx")

Error Codes

Error Type Meaning
Error The input view is a joined view; the input table is an ODBC table or a geographic layer; the input class is not a recognized class; the new_primary argument is null; or a file I/O error prevents the renaming of some files, because the user does not have file access, a source or a destination file is in use, or the files are renamed across different disk drives and the destination drive does not have enough disk space
NotFound The input table does not exist; or input table_name, class, primary and secondary are all null and there is no current view

See Also

Function Summary
ListTableFiles() Lists all the files associated with a table or view
DeleteTableFiles() Deletes all files associated with a table
CopyTableFiles() Copies all files associated with a table
RenameDatabase() Renames a geographic file
CreateTable() Creates an empty table and opens it as a view