Visual Basic Concepts

Closing Unneeded RDO Connections

When you no longer need access to the remote server, you should consider closing the connection with the Close method. While it does not always make sense to close a connection before an application is terminated, schemes used to maximize the number of simultaneous users connected to a system often close connections when they become idle or are no longer needed. These applications subsequently reopen the connections as required.

When your connection is dropped, any instance-owned objects on the server are released. For example, server-side cursors or any objects created in TempDB are dropped by the server. If you must maintain access to these objects, you cannot close your connection.

RDO does not manage connections for you in the sense that it does not cache recently closed connections in anticipation of their use at a later time. When you use the Close method to close a connection, or the last reference to an rdoConnection object goes out of scope, the connection is closed — permanently and immediately.