Creates a new database within an application, either on the client or the server. If the database is created on the server, it is also started.
Syntax
EsbCreateDatabase (hCtx, AppName, DbName, DbType) ByVal hCtx As Long ByVal AppName As String ByVal DbName As String ByVal DbType As Integer
Parameter | Description |
---|---|
hCtx | VB API context handle. |
AppName | Name of an application to contain database. |
DbName | Name of a database to create. See Database Name Limits. |
DbType | Type of database to create: (ESB_DBTYPE_NORMAL/ESB_DBTYPE_CURRENCY). |
Notes
Creating a client database creates a directory to contain local database files.
A newly created database or application is not automatically set to active. Call EsbSetActive() after calling EsbCreateDatabase() or EsbCreateApplication() to keep subsequent functions, such as EsbRestructure(), from operating on the wrong database or application (the application or database that is already active).
Return Value
None.
Access
For a server database, the caller must have database Create/Delete/Edit privilege (ESB_PRIV_DBCREATE).
Example
Declare Function EsbCreateDatabase Lib "ESBAPIN" (ByVal hCtx As Long, ByVal AppName As String, ByVal DbName As String, ByVal DbType As Integer) As Long Sub ESB_CreateDatabase () Dim sts As Long Dim AppName As String Dim DbName As String AppName = "Sample" DbName = "Basic" '**************** ' Create database '**************** sts = EsbCreateDatabase (hCtx, AppName, DbName, ESB_DBTYPE_NORMAL) End Sub
See Also