FILEFLEX API REFERENCE



NAME
DBCreate -- Create a new database

SYNTAX
DBCreate(database-name, num-fields, field-list, overwrite-flag)

CATEGORY
Managing Database Files

DESCRIPTION
THIS FUNCTION HAS CHANGED IN FILEFLEX 3.0

You can use DBCreate to create a new database. DBCreate requires four parameters: the name of the database, the number of fields, a container containing a field list, and "true" or "false" (true if you don't want FileFlex to overwrite a data file).

Each line of the field list container is used for a field. Each line contains the following information: name of field, type of field, length, and number of decimal places (for numeric fields).

The type of field parameter may be one of the following:

  • 'N': Numeric
  • 'C': Character
  • 'B': Boolean
  • 'M': Memo
  • 'D': Date
  • 'B': Binary
  • 'F': Float
  • 'G': General


NOTES
DBCreate now creates a .FPT file for memos and other data rather than a .DBT file (the format used in earlier FileFlex versions).

In FileFlex 2, you could also use the FileFlex Database Designer. The Database Designer is obsolete in FileFlex 3. In FileFlex 3, you can create a new database using FoxPro (recommended), Access (specify FoxPro format), or programmatically, using DBCreate or DBCreateAuto.

DBCreate has been modified so it works properly with the safety functions and actually matches how the manual describes it (this was not the case in earlier versions...hey, we get better with age!) FileFlex now recognizes "true" or "t" in the safety field as an instruction to prevent overwriting the database and "false" or "f" as an instruction to allow overwriting.


EXAMPLE
put DBCreate("FRIENDS",6, dbFields,"false") into dbResult

SEE ALSO
DBCreateAuto, DBCreateIndex

INTERNAL FUNCTION NUMBER
33


Copyright © 1992-1998 by David Gewirtz, under license to Component Enterprises, Inc.
Contact: info@component-net.com

Casa de Bender