Displaying a table of data from database

Hi all,

How to display a database on a SCADA Screen after doing some SQL CICODE programs (or using a database Exchange Control).

I found this example program in Citect Help,

/* Make a connection to an SQL server and select the name field from each record in the employee database. */

 

FUNCTION ListNames()

INT hSQL;

STRING sName;

INT Status;

hSQL = SQLConnect("DSN=MyDatabase;UID=billw;SRVR=CI1");

IF hSQL <> -1 THEN

Status = SQLExec(hSQL, "SELECT NAME FROM EMPLOYEE");

IF Status = 0 THEN

WHILE SQLNext(hSQL) = 0 DO

sName = SQLGetField(hSQL, "NAME");

END

SQLEnd(hSQL);

ELSE

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

END

SQLDisconnect(hSQL);

ELSE

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

END

END

Can anyone help me how to display the table on SCADA screen?

Parents
  • Thanks Dhruv,

    I use Database Exchange control to display the table. But my query is different.

    I need to execute SELECT select statement using CICODE and display the modified table .

    So my query is how to take the output from the above code and display the table on SCADA screen.
Reply
  • Thanks Dhruv,

    I use Database Exchange control to display the table. But my query is different.

    I need to execute SELECT select statement using CICODE and display the modified table .

    So my query is how to take the output from the above code and display the table on SCADA screen.
Children
No Data