Xbasic
SQL::ConnectionClose Method
Syntax
V Close([CloseSSHTunnel as L])
Arguments
- CloseSSHTunnelLogical
Default = .f.. If .t., any associated SSH tunnel will be forced closed when the connection is closed.
Description
Close a SQL connection.
Discussion
The Close() method closes a SQL connection if it is open.
The optional argument CloseSSHTunnel defaults to false. Setting this value to .t. will force any associated SSH tunnel to close along with the connection.
In most cases you want an SSH tunnel to remain open for the life of the process because establishing a tunnel is expensive.
Example
dim conn as SQL::Connection dim connString as C IF .not. conn.open(connString) THEN ui_msg_box("Error", conn.CallResult.Text) end END IF ... conn.close()
Calling the close() method is optional but may result in better performance.
See Also