Partager via


How to: Test a Connection for Availability

When a connection is busy, such as when Visual FoxPro is progressively fetching data into a cursor, you don't want to start another fetch or send updates on the same connection. You can determine whether a connection is busy with the ConnectBusy property, which returns a value of true (.T.) if the connection is busy. You can use this property in your application to test a connection before sending a request over a shared connection to a remote data source.

To determine whether a connection is busy

You need the connection handle to use the SQLGETPROP( ) function. You can identify the connection handle for an active view with the ConnectHandle property of the CURSORGETPROP( ) Function. The following code identifies a connection handle and then uses the connection handle to test whether the connection is busy:

nConnectionHandle=CURSORGETPROP('ConnectHandle')
SQLGETPROP(nConnectionHandle, "ConnectBusy")

See Also

Tasks

How to: Optimize View Performance

How to: Optimize Filters and Joins

How to: Create Queries (Visual FoxPro)

How to: Share Connections for Multiple Remote Views