How to: Test a Connection for Availability

JavaScript Editor js editor     Web development 



Main Page

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:

В Copy Code
nConnectionHandle=CURSORGETPROP('ConnectHandle')
SQLGETPROP(nConnectionHandle, "ConnectBusy")

See Also



JavaScript Editor js editor     Web development