This command opens the Database Designer to let you interactively change the structure of a database (DBC).
MODIFY DATABASE [ Name | ? ] [ NOWAIT ] [ NOEDIT ]
If both Name and the "?" are omitted, the current database is opened. If there is no current database, the Open dialog lets you choose one. If Name isn't open, MODIFY DATABASE
opens it, sets it as the current database, and brings up the Database Designer. Note that, in this case, the current setting of EXCLUSIVE determines whether you'll actually be able to make any changes.
In VFP 7, if the database has Database Events
turned on, the ModifyData event fires.
Be careful what you assume with MODIFY DATABASE
. When you USE a table that's part of a database, the database gets opened automatically, but does not become the current database. If you then MODIFY DATABASE
<that database name>, you'd expect to see the OPEN DATABASE
. However, if you're in a different directory and the directory containing the database isn't in your FoxPro path, you'll actually be creating a new database in the current directory.
NOWAIT lets you open the Database Designer in a program and leave it waiting while you issue other commands.
NOEDIT allows you to view the database schema, but prevents you from inadvertently making changes to it. Be aware that the NOEDIT keyword isn't as strong as the NOUPDATE keyword of OPEN DATABASE
. Although you can't visually add and remove things from the database, you can do so programmatically.
MODIFY DATABASE MyData