Share via


CLOSE Commands

Closes various file types.

CLOSE [ALL | ALTERNATE | DATABASES [ALL] | DEBUGGER | FORMAT | INDEXES
   | PROCEDURE | TABLES [ALL]]

Parameters

  • ALL
    Closes all open databases, tables, and indexes in the current and any inactive data sessions and selects work area 1. CLOSE ALL also closes any files opened with the FCREATE( ) and FOPEN( ) low-level file functions. CLOSE ALL does not close a file opened with SET PRINT.

    CLOSE ALL also closes the following:

    • Form Designer
    • Project Manager
    • Label Designer
    • Report Designer
    • Query Designer

    CLOSE ALL does not close these:

    • Command window
    • Debug window
    • Help
    • Trace window
  • CLOSE ALTERNATE
    Closes an alternate file opened with SET ALTERNATE.

  • CLOSE DATABASES [ALL]
    Closes the current database in the current data session and its tables. If there is no current database, all open free tables, indexes, and format files in all work areas in the current data session are closed, and work area 1 is selected.

    The ALL keyword specifies that the following are closed in the current and all inactive data sessions:

    • All open databases and their tables, except for currently selected databases in other data sessions or databases and their tables that are open in other data sessions.
    • All open free tables.
    • All indexes and format files in all work areas.
    • Work area 1 is selected.
  • CLOSE DEBUGGER
    Closes the Visual FoxPro debugger.

  • CLOSE FORMAT
    Closes a format file in the current work area opened with SET FORMAT.

  • CLOSE INDEXES
    Closes all open index files (both single-entry .idx and independent compound .cdx files) in the current work area. A structural compound index (a .cdx file automatically opened with the table) is not closed.

  • CLOSE PROCEDURE
    Closes a procedure file opened with SET PROCEDURE.

  • CLOSE TABLES [ALL]
    Closes all tables in the currently selected database. CLOSE TABLES closes all free tables in all work areas if a database isn't open.

    Include ALL to close all tables in all databases, and all free tables. All databases remain open.

    CLOSE TABLES should not be issued when a transaction is in progress; Visual FoxPro will generate an error message.

See Also

ADD TABLE | CLOSE MEMO | CREATE DATABASE | Close Method