UltraLite for MobileVB User's Guide
Understanding UltraLite for MobileVB Development
Connecting to the UltraLite database
To connect to an UltraLite database using ULConnectionParms
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.
Double click the ULConnectionParms object. The ULConnectionParms object appears on your form.
In the ULConnectionParms properties palette, type in the location of the database, schema files and username and password for your database.
Create your ULDatabaseManager object.
The following code declares a ULDatabaseManager object named dbMgr
Public dbMgr As New ULDatabaseManager
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.