Syntax
| SQL.ResetConnection
|
|---|---|
Description
| Resets the current database connection by performing the following steps in sequence:
The function returns True when the new connection was established successfully, or False if the reconnection failed (e.g. due to a network error or invalid connection string).
This method is primarily intended for use in error recovery scenarios in long-running scripts, such as EDI processing loops or batch import macros, where a database error may leave the connection in an unusable state. Rather than requiring the entire script to be restarted, a call to SQL.ResetConnection restores a clean connection for subsequent queries.
Note: In the Tradium IDE (interactive debugging), error recovery typically works without an explicit reset because the IDE re-initializes certain state between runs. However, when the same script runs in the Tradium e-Comms Server runtime (MacroHandler), error state persists across loop iterations. SQL.ResetConnection was designed to address this asymmetry.
Important: SQL.ResetConnection does not affect any open ADODB.Recordset objects that were obtained via SQL.RunRecordset. These must be closed individually by the script before or after calling ResetConnection.
|
See Also
| |
Example
| Sub Main |