|
Creates a database by adding an entry to dbnames.cfg file. This entry is later used to create DSNs.
Header file: CATALOG.HRequires: W3DBAV75.DLL or higher version
BTI_SINT PvCreateDatabase( BTI_LONG hConnection, BTI_CHAR_PTR dbName, BTI_CHAR_PTR dictPath, BTI_CHAR_PTR dataPath, BTI_ULONG dbFlags);
|
In
|
hConnection
|
Connection handle that identifies the server. Connection handles are obtained with the PvConnectServer() function.
|
|
In
|
dbName
|
Name of the database.
|
|
In
|
dictPath
|
Dictionary path.
|
|
In
|
datapath
|
Data path. Pass an empty string to use the default data path (that is, the same as the dictionary path)
If you want to create a database that consists of MicroKernel data files located in multiple paths, specify this parameter as a semicolon (;) delimited list. For example:
C:\data\path1;C:\data\path2
|
|
In
|
dbFlags
|
Database flags, which can be a combination of the P_DBFLAG_ constants.
P_DBFLAG_RI (enforce integrity constraints, including referential integrity and triggers)
P_DBFLAG_BOUND (DDF Files are created. The database name will be stamped on the dictionary files and only that dictionary can use them. If the database is not bound, then several databases can use the same dictionary file set). If trying to create a bound database and you want to bind to DDF files that already exist, you should specify P_DBFLAG_CREATE_DDF together with P_DBFLAG_BOUND.
P_DBFLAG_CREATE_DDF (DDF files are created. The directory specified in dictionary has to exist).
P_DBFLAG_DBSEC_AUTHENTICATION (Database Security Authentication - Mixed Btrieve security policy)
P_DBFLAG_DBSEC_AUTHORIZATION (Database Security Authorization - Database Btrieve security policy)
|
The following preconditions must be met:
The following table indicates how to specify a security model in a new database, or to interpret the security model of an existing database. Using any other combination of flags for security will result in status code 7024.
|
This Flag Combination
|
Represents this Security Model
|
|
No flags
|
Classic
|
|
P_DBFLAG_DBSEC_AUTHENTICATION
|
Mixed
|
|
P_DBFLAG_DBSEC_AUTHENTICATION + P_DBFLAG_DBSEC_AUTHORIZATION
|
Database
|
BTI_LONG connectionHandle = P_LOCAL_DB_CONNECTION; BTI_CHAR_PTR dataPath = "c:\\data\\gallery"; BTI_CHAR_PTR dictPath = "c:\\data\\gallery"; BTI_CHAR_PTR databaseName = "Gallery"; BTI_SINT status = 0; BTI_CHAR_PTR server = "MyServer"; BTI_CHAR_PTR user = "Administrator"; BTI_CHAR_PTR pwd = "Admin"; //only need to connect to server if it is remote //otherwise can pass P_LOCAL_DB_CONNECTION for the handle status = PvCreateDatabase( connectionHandle, databaseName, dictPath, dataPath, P_DBFLAG_CREATE_DDF);
PvStart()
PvConnectServer()
PvGetDbFlags()
PvModifyDatabase()
PvDropDatabase()
PvDisconnect()
PvStop()
|
Chapter contents
Prev topic: PvCountSelectionItems()
|