How To Create an Asynchronous Connection in ADO (194960)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
- Microsoft Data Access Components 2.1 SP2
- Microsoft Data Access Components 2.6
This article was previously published under Q194960 SUMMARY
Often, operations involving a database can take some time to process a
query, connect to a datasource, or retrieve results to a client. ADO
provides a way to perform these operations asynchronously. With this
ability, developers can also do other tasks during a long operation, such
as displaying a progress dialog box, or offer the user the chance to cancel
the operation.
An asynchronous connection can be established in ADO by using the Options
parameter to the Connection object's Open method. The following example
creates an asynchronous DSN-less connection using the SQL Server driver,
waits for the connection to be established, then displays connection
properties for that connection. It also demonstrates the use of the WITH
statement to set multiple properties of the connection object. To use this
example, you must have Microsoft Data Access Components (MDAC) version 2.1
or later installed, which is included in the data components of Visual
Studio 6.0 or can be downloaded from:
Modification Type: | Minor | Last Reviewed: | 6/29/2004 |
---|
Keywords: | kbDatabase kbhowto KB194960 |
---|
|