DB_Create

This function creates an empty database file. DBBLOCK is a pointer to a structure that the database maintains. This block allows the engine to keep track of the opened database. The DBBLOCK structure can be examined, but should not be modified.

If a file exists with the path pointed to by filename, DB_Create removes that file. If the database creation fails either because of lack of disk space or lack of memory, the partial database file is removed.

The filetype is a unique character supplied by the application that indicates the type of file (i.e. Appointment book, Phone Book, etc.). This field is not used by the database, but can be used by applications to determine if the database file is of the proper type.

Creating a database with filetype=0 allows that file to be read into any database application; DB_Opening an existing database file and passing filetype=0 allows the application to open any database file type. The file types of the built-in applications are

FieldCallBack is a pointer to a function that is used to sort and filter unknown database formats. It can be NULL if the application does not have any call back fields. See "User-defined Field types (FieldCallBack)" on page 11-441 for more details.

The ROMCount and ROMCallBack fields are 0, unless the application requires ROM record support. See Miscellaneous:ROMCallBack for more details.

The date and time of the file's creation are recorded in the last reconciled field in the header block. They will indicate the original creation date of the file (unlike DOS's file timestamp). Reconciliation software should reset this time and date after reconciling the contents with another copy of the database.