Aracılığıyla paylaş


DELETE DATABASE Command

Deletes a database from disk.

DELETE DATABASE DatabaseName | ? [DELETETABLES] [RECYCLE]

Parameters

  • DatabaseName
    Specifies the name of the database to delete from disk. The database you specify cannot be open. DatabaseName can include the path to the database with the database name.

  • ?
    Displays the Delete dialog box from which you can specify the name of the database to delete from disk.

  • DELETETABLES
    Deletes the tables contained in the database from disk and the database containing the tables.

  • RECYCLE
    Specifies that the database isn't immediately deleted from disk and is placed in the Windows Recycle Bin.

Remarks

Always use DELETE DATABASE to delete a database from disk. Unlike the file manipulation utility of the operating system, DELETE DATABASE removes references to the database from the tables in the database.

If SET SAFETY is ON, Visual FoxPro asks if you'd like to delete the database you specify. If SET SAFETY is OFF, the database is automatically deleted from disk.

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.

DELETE DATABASE is used with the DELETETABLES option to remove the database and its friends table from disk.

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

See Also

Reference

ADD TABLE Command

CLOSE Commands

DBC( ) Function

DBGETPROP( ) Function

DBSETPROP( ) Function

DISPLAY TABLES Command

OPEN DATABASE Command

REMOVE TABLE Command

Other Resources

Commands (Visual FoxPro)

Language Reference (Visual FoxPro)