Contents Index Connecting to the UltraLite database Using a connection string to connect

UltraLite for MobileVB User's Guide
  Understanding UltraLite for MobileVB Development
    Connecting to the UltraLite database

Using ULConnectionParms to connect


To connect to an UltraLite database using ULConnectionParms

  1. Place the ULConnectionParms object on your form and ensure all of the database and schema parameters are complete.

    You need one ULConnectionParms object per application. The ULConnectionParms object is located on the MobileVB tool palette.

  2. Create your ULDatabaseManager object.

    The following code declares a ULDatabaseManager object named dbMgr

    Public dbMgr As New ULDatabaseManager
  3. Create and open a connection to the database.

    The ULDatabaseManager CreateDatabaseWithParms and OpenConnectionWithParms methods create a database and open a connection. Each takes a single ULConnectionParms object as its argument. The ULConnectionParms object is is composed of a set of parameters that you created when you placed the ULConnectionParms object on your form and filled in the vital properties. A schema file must be specified for CreateDatabaseWithParms and a database file must be specified for OpenConnectionWithParms.

    The following properties, shown in the ULConnectionParms property palette, are mandatory for CreateDatabaseWithParms:

    Keyword Description
    SchemaOnDesktop The path and filename of the UltraLite schema. The default extension for UltraLite schema files is .usm. SchemaOnDesktop is required when using CreateDatabaseWithParms on Windows desktop operating systems. SchemaOnCE has precedence over SchemaOnDesktop. Required for CreateDatabaseWithParms.
    SchemaOnCE The path and filename of the UltraLite schema on Windows CE. The default extension for UltraLite schema files is .usm. This is a required parameter when using CreateDatabaseWithParms for CE.
    SchemaOnPalm If using Palm, the name of the UltraLite schema for Palm. SchemaOnPalm is a required parameter when using CreateDatabaseWithParms on Palm devices. The Palm file extension is .pdb. Do not specify the extension in the SchemaOnPalm parameter.

    For more information on connection parameters used WithParms, see DatabaseManager.

    Most applications use a single connection to an UltraLite database, and keep the connection open all the time. For this reason, it is often best to declare the ULConnection object global to the application.


Contents Index Connecting to the UltraLite database Using a connection string to connect