Applies To:
  • CitectSCADA 5.50, 5.50 Service Pack A, 5.50 Service Pack B, 5.50 Service Pack C, 6.00, 6.00 Service Pack A
  • CitectHMI 5.50, 5.50 Service Pack A, 5.50 Service Pack B, 5.50 Service Pack C, 6.00, 6.00 Service Pack A

Summary:
How do I know if an SQL connection is offline or online. 

Solution:
First, check that SQL server is added in the ODBC connections in control panel.

You can use the below Cicode to test the SQL server connections.

/*Test an SQL server Connection, Using Microsoft ODBC Connections*/

/*continuously test connection by looping */

/*prompts an error message when connection is lost*/


FUNCTION
Connect()

    INT hSQL;

    WHILE hSQL <>-1 DO

        hSQL = SQLConnect("DSN=SQL Test");

    END

    IF hSQL = -1 THEN

        Message("Error", SQLErrMsg(), 48);

    END

    SQLDisconnect(hSQL);

END

 

Keywords:
SQL,connection, SQL server,SQL connection  

Attachments