Contents Index Using ULConnectionParms to connect to a database Using frames to maintain application state (JScript)

UltraLite ActiveX User's Guide
  Understanding UltraLite ActiveX Development
    Connecting to an UltraLite database

Using a connection string to connect to a database


The following procedure connects to a database using the functions OpenConnection and CreateDatabase. These methods accept connection information as a connection string.

For more information about connecting to an UltraLite database using a connection string, see CreateDatabase method and OpenConnection method.

To connect to an UltraLite database

  1. Create a ULDatabaseManager object.

    You should create only one DatabaseManager object per application. This object is at the root of the object hierarchy. For this reason, it is often best to declare the DatabaseManager object global to the application.

    ' eMbedded Visual Basic
    Dim DatabaseMgr As ULDatabaseMgr
    Set DatabaseMgr = CreateObject("UltraLite.ULDatabaseManager")
    // JScript
    var DatabaseMgr;
    DatabaseMgr = new ActiveXObject( "UltraLite.ULDatabaseManager" );
  2. Declare a ULConnection object.

    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.

    'eMbedded Visual Basic
    Dim Connection As ULConnection
    // JScript
    var Connection;
  3. Open a connection to the database.


Contents Index Using ULConnectionParms to connect to a database Using frames to maintain application state (JScript)