Rdo Engine
Rdo Engine
Rdo Engine
The rdoEngine object represents the remote data source and is created automatically
when you first make reference to an RDO object or the RemoteData control. As the top-
level object, it contains all the other objects in the hierarchy of Remote Data Objects. The
rdoEngine object is predefined, therefore you can’t create additional rdoEngine objects,
and it isn’t a member of any collection. You can use the rdoEngine to set data source
parameters and create additional rdoEnvironment objects.
Even though the rdoEngine is shared among the various applications that use it, the
rdoEngine default properties are not shared between applications. Each instance of your
application is provided with its own set of default values that have no effect on other
applications that also use RDO or the RemoteData control.
Note Adding the RemoteData control to your Toolbox does not automatically set a
reference to the Microsoft Remote Data Object library. To use the rdoEngine and Remote
Data Objects from code, you must set a reference to the Microsoft Remote Data Object
2.0 object library in the References dialog box (available from the Projects menu);
otherwise, you will get a compilation error when the first RDO object is referenced. Also,
If you have Visual Basic version 4.0 or Microsoft Office installed on your computer, the
RDO 1.0 library might appear in the list of object libraries exposed by the Project
References dialog. While using this library is possible with Visual Basic version 5.0 or
later, it is not recommended.
With RDO and the RemoteData control, your applications can access ODBC data sources
without using a local query processor. This can mean significantly higher performance
and more flexibility when accessing remote database engines.
Execute stored procedures that return result sets with or without output
parameters and return values.
Monitor all of the messages and errors generated by the remote data source
without compromising the executing query.
The User Connection Designer uses Microsoft Visual Basic’s new class designer
architecture to provide design-time support for programmatic data access. It allows you
to create connection and query objects (based on Remote Data Objects) at design time.
These connections and queries are persisted as project-level objects. You can preset
properties, define new properties and methods, and write code behind the objects to trap
events.
This provides a simplified method for responding to events raised from connections and
queries as well as for calling stored procedures and client-defined queries at run time.
RDO and the RemoteData control can help you meet a specific set of client/server
requirements. By using these remote data access features, you can:
Gain high-performance data access against remote ODBC data sources. The
ability to quickly retrieve the results from complex queries is a goal of every data
access application. RDO provides a level of performance rivaled only by the
ODBC and VBSQL API programming models. By leveraging the remote data
engine, RDO greatly improves response time and user productivity.
Manage return codes and both input and output parameters from stored
procedures. Output parameters are the only way to extract information from an
Oracle stored procedure, and are used heavily for singleton queries and many
administrative functions. In many cases, you cannot determine if a stored
procedure completed successfully without accessing the procedure’s return value.
RDO supports access to each of these parameters through the rdoParameter
object.
Manage multiple result sets. By using a single query that returns several sets of
results, you can use the query processor and system resources more efficiently.
You can improve performance by running a single query to gather data to fill
multiple data-driven list boxes and menus. In addition, by combining a row-count
query with a SELECT query, you can accurately set up scroll bars and progress
status bars.
Continue queries after initial timeout period. When a query exhausts the period
set in the QueryTimeout property, RDO permits you to override query
cancellation and continue waiting for another timeout period.
Support dissociated result sets. RDO permits you to create a static read-write
cursor and break the connection with the remote server. The data in the
rdoResultset object remains available for access or changes. Once you re-
associate the result set with another rdoConnection object, you can use the
BatchUpdate method to post these offline changes to the database.
Create and manage optimistic batch updates. While the ODBC cursor library
supports the concept of optimistic updates, it does so on a row by row basis rather
than a batch basis. This type of update operation consumes considerable network
and server bandwidth. RDO leverages the new Client Batch cursor library that
groups sets of rows to be inserted, updated, or deleted. This way, only one round
trip to the server is needed, thus improving update performance and decreasing
network traffic.
Make the use of stored procedures easier. RDO permits you to express
parameterized queries and stored procedures as methods of a parent
rdoConnection object. You can pass parameters just as you would to any Visual
Basic function without having to manipulate any rdoParameter objects.
Expose underlying ODBC handles. In cases where you need more flexibility or
control than is available in the object model, you should have a way to directly
access the data source. RDO provides access to the ODBC environment,
connection, and statement handles.
Reduce memory footprint. In many cases, the system that hosts a client/server
front-end application is limited in RAM capacity. Because of this, it is important
that applications designed for these systems economize their use of RAM and
other workstation system resources. The RDO memory footprint is dramatically
smaller than other programming models, and it does not require the use of local
memory or disk space for its lowest-level cursors.
Remote Data Objects are also created by using methods on the parent object, or by
declaring the objects with the Dim statement. If you use the Dim as New statement to
instantiate a new object, the object is not appended to the associated collection. The
following table shows how to create each of the primary Remote Data Objects:
You can use the rdoEnvironment object's OpenConnection method to open connections
to the data source.
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: