FILEFLEX API REFERENCE



NAME
DBCreateAuto -- Create a new database with integrated index

SYNTAX
DBCreateAuto(database-name, num-fields, fields, num-tags, tags, overwrite-flag)

CATEGORY
Managing Database Files

DESCRIPTION
NEW IN FILEFLEX 3.0

DBCreateAuto creates an "automatic" or "structural" (FoxPro term) index file at the same time the data file is created. The automatic index file is opened at the same time as the data file.

Here's the format for a tag record:

tagname,index-expr,filter-expr,order,uniq-flag

Order must be 'A' for ascending or 'D' for descending. If filter-expr is "0", then no filter is applied. There can be any number of tags per index file (separated by newlines), allowing for lots of complex orderings. The new indexes allow for complex filtering operations, uniqueness, and more. Indexes created with DBCreateAuto can not be closed with DBCloseIndex.

Like DBCreate, DBCreateAuto has an overwrite flag that's "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
DBCreateAuto now creates a .FPT file for memos and other data rather than a .DBT file (the format used in earlier FileFlex versions). It also creates a .CDX (compound, compact index) rather than the .NDX format used in previous FileFlex versions.

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, field dbFields, 2, taglist, "false") into dbResult

SEE ALSO
DBCreate, DBCreateIndex

INTERNAL FUNCTION NUMBER
53


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

Casa de Bender