Viewing and Setting Database Properties

Each Visual FoxPro database has Version and Comment properties. You can view and set these properties with the DBGETPROP( ) and DBSETPROP( ) functions.

For example, the following code displays the version number of the testdata database:

? DBGETPROP('testdata', 'database', 'version')

The value returned represents the Visual FoxPro .dbc version number, and is read-only. Using the same function, you can view the comment, if one exists for the database:

? DBGETPROP('testdata', 'database', 'comment')

Unlike the Version property, the Comment property can be set. Use the DBSETPROP( ) function to enter a description or other text that you want to store with the database.

To set the comment property on the current database

  • In the Database Designer, choose Properties from the Database menu and type a comment in the Comment box.

    -or-

  • Use the comment option of the DBSETPROP( ) function.

For example, the following code changes the comment for the testdata database:

? DBSETPROP('testdata', 'database', 'comment', ;
  'TestData is included with Visual FoxPro')

You can also use the DBGETPROP( ) and DBSETPROP( ) functions to view and set properties on other database objects such as connections and views.

See Also

Creating Stored Procedures | Viewing and Modifying Database Architecture | Extending Database Files | Building Referential Integrity | Creating Databases | Working with a Database