Contents Index Properties CreateDatabaseWithParms method

UltraLite ActiveX User's Guide
  UltraLite ActiveX API Reference
    ULDatabaseManager class

CreateDatabase method


CreateDatabase creates a new database and returns a connection to it.

Prototype 

CreateDatabase( parms As String ) As ULConnection
Member of UltraliteActiveX.ULDatabaseManager

Description 

Creates a new database and returns a connection to it. It fails if the specified database already exists. A valid schema file must be specified to successfully create a database. To alter the schema of an existing database, use the ULDatabaseSchema ApplyFile method.

Caution  
Only one database may be active at a given time. Attempts to create a different database while other connections are open will result in an error.

For more information about ApplyFile, see ULDatabaseSchema class and ApplyFile method.

Parameters 

parms    A semicolon-separated list of database creation parameters.

For information about connection parameters, see Connection Parameters.

Returns 

Returns a connection to a newly created UltraLite database.

Examples 

The example below uses CreateObject to create and open a new database.

' eMbedded Visual Basic
open_parms = "file_name=\tutCustomer.udb"
schema_parms = open_parms & ";" & "schema_name=\tutCustomer.usm"
Set DatabaseMgr = CreateObject("UltraLite.ULDatabaseManager")
Set Connection = DatabaseMgr.CreateDatabase(schema_parms)
// JScript
open_parms = "file_name=\\tutCustomer.udb";
schema parms = open_parms + ";" + "schema_name=\\tutCustomer.usm"
DatabaseMgr = new ActiveXObject("UltraLite.ULDatabaseManager")
Set Connection = DatabaseMgr.CreateDatabase(schema_parms);

The example below shows how you can create a ULDatabaseManager with events. This tactic is used for showing synchronization progress.

This functionality is only available with eMbedded Visual Basic.

For more information about showing synchronization progress, see Monitoring synchronization progress.

'eMbedded Visual Basic
Set DBMgr = CreateObjectWithEvents("UltraLite.ULDatabaseManager", "_")

For information about connection parameters, see OpenConnection method.


Contents Index Properties CreateDatabaseWithParms method