hi.
I want to connect to sql server and i get data from it and 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.
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
I want to connect to sql server and i get data from it and 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.
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