Visual Basic Concepts
Managing Connections with the rdoEnvironment Object
You can use the rdoEnvironment object's OpenConnection method to open connections to the data source and create rdoConnection objects to manage and reference these connections. In an rdoEnvironment, you can open multiple connections (each accessing its own database), manage transactions, and establish security based on user names and passwords. For example, you can:
- Create an rdoEnvironment object using the Name, Password, and UserName properties to establish a named, password-protected environment. The environment creates a scope in which you can open multiple connections and manage multiple ODBC transactions.
- Use the OpenConnection method to establish one or more connections in that rdoEnvironment.
- Use the BeginTrans, CommitTrans, and RollbackTrans methods to manage ODBC transaction processing within an rdoEnvironment.
- Use several rdoEnvironment objects to conduct multiple, simultaneous, independent, and overlapping transactions.
- Use the
Dim X as New
rdoConnection
to create a stand-alone rdoConnection object and use the Add method to append it to the rdoConnections collection of an rdoEnvironment object.
- Use the Remove method to remove a specified rdoConnection object from its parent rdoConnections collection.
- Use the Close method to terminate an environment and the connection.
Note It is no longer always necessary to reference the rdoEnvironment object because rdoConnection objects can be created as stand-alone objects.