Opens a database.

OPEN DATABASE [FileName | ?] [EXCLUSIVE | SHARED] [NOUPDATE] [VALIDATE]

Parameters

FileName

Specifies the name of the database to open. If you do not specify an extension for the file name, Visual FoxPro automatically assigns a .dbc extension. If you omit FileName, the Open dialog box is displayed. You can specify a path name as part of the database name.

NoteNote

Visual FoxPro will not recognize a path name properly if a disk or directory name contains an exclamation point (!).

?

Displays the Open dialog box from which you can choose an existing database or enter the name of a new form to create.

EXCLUSIVE

Opens the database in exclusive mode. If you open the database exclusively, other users cannot access it and will receive an error if they try to gain access. If you do not include EXCLUSIVE or SHARED, the current SET EXCLUSIVE setting determines how the database is opened.

SHARED

Opens the database in shared mode. If you open the database for shared use, other users have access to it. If you do not include EXCLUSIVE or SHARED, the current SET EXCLUSIVE setting determines how the database is opened.

NOUPDATE

Specifies that no changes can be made to the database. In other words, the database is read-only. If you omit NOUPDATE, the database is opened with read/write access.

Tables contained in the database are not affected by NOUPDATE. To prevent changes to a table in the database, include NOUPDATE in USE when you open the table.

VALIDATE

Specifies that Visual FoxPro ensures that references in the database are valid. Visual FoxPro checks to see that tables and indexes referenced in the database are available on disk. Visual FoxPro also checks to see that referenced fields and index tags exist in the tables and indexes.

Expand imageRemarks

Expand imageExample

Expand imageSee Also