CLEAR POPUPS

Modify Database

This command opens the Database Designer to let you interactively change the structure of a database (DBC).

Usage

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.

When you use NOEDIT, you shouldn't be able to edit the stored procedures for the database, and you can't if you choose Edit Stored Procedures from the Database or shortcut menus (the code editor window is read-only). However, if you bring up the Properties window for the database and double-click on one of the database events in the list, the code editor window that comes up isn't read-only and will allow you to save any changes you make.


Example

MODIFY DATABASE MyData

See Also

Create Database, ModifyData, Open Database, Set Database


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net