Visual Basic Concepts

Using RDO to Submit Queries

The primary reason for creating most database front-ends is to retrieve data, manipulate it, display it, and submit changes. Most of the RDO code you write involves building queries and processing the result sets to perform these basic operations.

When you need data from the remote database, you submit a query that specifically calls for a set of data rows. When it comes time to update your data, you submit more queries that pass along new data or changes to the remote database. If your application needs to perform administrative functions, you submit queries that contain high-level instructions to run server-side utilities to establish new users, or run database repair or configuration procedures. In essence, all of the interactive aspects of RDO involve submitting queries. You are basically asking questions and working with the answers that are returned in the form of result sets.

Generally, RDO query processing can be broken down into two parts:

Query submission involves building an SQL statement, including any needed parameters, and sending the query to the remote server for processing. When deciding how to submit your query, you must decide what form it is to take when it is returned. Depending on the needs of your application, you should consider the following questions:

The following topics address these questions to help you choose the right strategy to fetch your data in a variety of situations.

Managing RDO Queries

Once you have opened a connection, you can submit queries to the remote server for execution. No matter which technique you use, RDO will execute your queries and retrieve the result sets with one of two ODBC API function sets as described below:

Note   The outdated Visual Basic version 4.0 rdoPreparedStatement object is still supported in Visual Basic version 6.0 for backward compatibility, but is not recommended for future development. You are encouraged to replace all references to rdoPreparedStatement objects with rdoQuery objects.