TODBCDisconnect

(Engine-Level Function)

Description: Stops a connection to the ODBC database. Similar to ODBCDisconnect except that it runs in its own thread (see "Comments" section for differences).
Returns: Nothing
Usage: Script Only.
Function Groups: Database and Data Source,  ODBC
Threaded: Yes
Related to: ODBC | ODBCConfigureData | ODBCConnect | ODBCDisconnect | ODBCSources | ODBCStatus | ODBCTables | TODBC | TODBCConnect
Format:  TODBCDisconnect(DB)
Parameter:  
DB
Required. An ODBC value for the ODBC database as returned by TODBCConnect or ODBCConnect.
Comments: When TODBCDisconnect is executed in its script, it starts its own thread which will not stop execution of VTScada, and which will exist until the connection to the database has been broken.

Example:

Main [
  If 1 Idle;
  [
    TODBC(ODBCHandle { Handle to database },
          "SELECT ALL * FROM Table1" { SQL command },
          Attrib, Result { Results of command },
          0, 0, 0 { No err details req'd });
  ]
]
Idle [
  If Valid(Result) Done;
  [
    TODBCDisconnect(ODBCHandle);
  ]
]