Visual Basic: RDO Data Control

rdoEngine Object

See Also    Example    Properties    Methods    Events

The rdoEngine object represents the remote data source. As the top-level object, it contains all other objects in the hierarchy of Remote Data Objects (RDO).



Remarks

The rdoEngine object can represent a remote database engine or another data source managed by the ODBC driver manager as a database. The rdoEngine object is a predefined object, therefore you can't create additional rdoEngine objects and it isn't a member of any collection.

The rdoEngine object is used to reference the rdoEnvironments collection, or establish default values for newly created rdoEnvironment objects. When an rdoEnvironment object is created, its properties are initialized based on the default values set in the rdoEngine. A default rdoEnvironments(0) object is created automatically when it is first referenced.

The rdoEngine object fires the InfoMessage event when an informational message is returned from the remote data source. Informational messages are indicated by an ODBC SQL_SUCCESS_WITH_INFO return code. These messages are placed in the rdoErrors collection. In cases where several messages arrive at once, only a single InfoMessage event is fired after the last message arrives and has been added to the rdoErrors collection.

Setting Default rdoEnvironment Properties

The following properties establish default settings for all newly-created rdoEnvironment objects. They are also used when instantiating stand-alone rdoConnection objects.

  • Use the rdoDefaultLoginTimeout property to determine the rdoEnvironment object's default LoginTimeout property used in connection timeout management.

  • Use the rdoDefaultCursorDriver property to determine the rdoEnvironment object's default CursorDriver value. This property determines if the ODBC driver manager creates client batch, local, server-side, or no cursors.

  • Use the rdoDefaultUser and rdoDefaultPassword properties to determine the default rdoEnvironment object's UserName and Password properties. These determine the user name and password when opening connections if no specific values are supplied.

Working with other rdoEngine Properties and Methods

You can establish the default configuration of new rdoEnvironment objects and create new ODBC data source entries using the properties and methods of the rdoEngine object. For example, you can:

  • Use the rdoEnvironments collection to examine rdoEnvironment objects that have been appended to the collection. Note that rdoEnvironment objects can be allocated as stand-alone objects.

  • Use the rdoLocaleID property to determine which language-localized DLLs are loaded.

  • Use the Version property to examine the version of RDO in use.

  • Use the rdoErrors collection to examine information about errors generated by the ODBC interface. Errors generated by Visual Basic are maintained in a separate Errors collection.

  • Use the rdoRegisterDataSource method to create a new data source entry in the Windows System Registry.

  • Use the rdoCreateEnvironment method to create a new rdoEnvironment object. You can also allocate a new rdoEnvironment object by coding

   Dim MyEnv as New rdoEnvironment