DBinitDatabase

Top  Previous  Next

Data bank initialize.

With this function a data bank area, usually the only data bank area, is initialized. This should not ordinarily occur from the user. He can use instead of this DBdeleteDatabase. With DBinitDatabase the following approaches are possible:

Put on only one new Workfile: read=0, oldRoot=0

load, in addition, the Workfile also from the file: read=1, oldRoot=0

there was already a data bank area and this should be used again.

oldRoot=1

It is important, for example if this area to the registering process is known:

read =?, oldRoot=<datenbankHandle>

Parametre

filename (char *) [IN]

With this parametre the name of the file is given which contains the Workfile, or should include. The file is opened and read if read 0 are not. While finishing the programme the data which are just in the data bank are stored in this file.

read (int) [IN]

read gives whether the data bank blank should remain (read=0) or whether it should be filled with the contents of the file filename (read! =0).

oldRoot (PROOT) [IN / OUT]

If here one of 0 different values stands, this is understood as a quite existing trading of a data bank which is initialized then only anew. Then as a result exactly this pointer is delivered. The contents of the data bank oldRoot are destroyed.

startDrawthread (int) [IN]

writemode (int) [IN]

transaction (int) [IN]

Result

(PROOT) [OUT]

This is the trading on a new or anew initialized data bank.

Declaration

#include "database.h"

 

PROOT DLLENTRY DBinitDatabase (

char * filename,

int read,

PROOT oldRoot,

int startDrawthread,

int writemode,

int transaction

);