Professional Documents
Culture Documents
Form Designer
Project Manager
Label Designer
Report Designer
Query Designer
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.
Note
Using CLOSE DATABASES in the Command window does not close a database if the database was
opened in the Project Manager by expanding its node or when a form is running in its own data session.
Under these circumstances, the database remains open until the Project Manager closes the database or
until the form using the database closes.
The ALL keyword specifies to close the following items in current and all inactive data sessions and that work
area 1 is selected:
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.
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.
Example
This example creates a database named people. A table named friends is created and is automatically added to
the database. DISPLAY TABLES is used to display the tables in the database, and DISPLAY DATABASES is used to display
information about the tables in the database.
Copy Code
This example creates a database named people. A table named friends is created and is automatically added to
the database. DISPLAY TABLES is used to display the tables in the database, and DISPLAY DATABASES is used to display
information about the tables in the database.
DELETE DATABASE is used with the DELETETABLES option to remove the database and its
Copy Code
CLOSE ALL
CREATE DATABASE people
CREATE TABLE friends (FirstName C(20), LastName C(20))
CLEAR
DISPLAY TABLES && Displays tables in the database
DISPLAY DATABASES && Displays table information
CLOSE ALL
DELETE DATABASE people DELETETABLES