M
Hi,
I want to connect to SQL server and get data from it. I show it on textbox in Citect SCADA 2018. I have this code for this task. Data does not show on textbox. Please say your idea for me.
I want to connect to SQL server and get data from it. I show it on textbox in Citect SCADA 2018. I have this code for this task. Data does not show on textbox. Please say your idea for me.
Code:
INT
FUNCTION
GetNames()
INT hSQL;
STRING sName;
INT Status;
hSQL = SQLConnect( "DSN=impaytere_ss" );
IF hSQL <> -1 THEN
Status = SQLExec( hSQL,"SELECT CNAME FROM FETISH WHERE SURNAME = 'Jumpy' " );
IF Status = 0 THEN
WHILE SQLNext( hSQL ) = 0 DO
sName = SQLGetField( hSQL, "CNAME" );
// whatever you wish to do with this data...
END;
SQLEnd( hSQL );
ELSE
Message( "Error", SQLErrMsg(), 48 );
END;
ELSE
Message( "Error", SQLErrMsg(), 48 );
END;
RETURN sName
SQLDisconnect( hSQL );
END