junior_nns
Member
Hello!
I'm work with Vijeo Citect 7.4, and I have a connection with SQL Server by ODBC.
Bellow, my string to insert data into SQL Server:
hSQL=SQLConnect("DSN=ODBCNAME;UID=user;PWD=password")
IF hSQL <> -1 THEN
hE1QueryInsert = SQLQueryCreate(hSQL);
SQLSet(hE1QueryInsert, "INSERT IGNORE INTO Table");
SQLAppend(hE1QueryInsert, "(Col1, Col2)");
SQLAppend(hE1QueryInsert, " values (?,?)");
SQLParamsClearAll(hE1QueryInsert);
SQLParamsSetAsInt(hE1QueryInsert, "Col1", iCol1);
SQLParamsSetAsInt(hE1QueryInsert, "Col2", iCol2);
FB_SQL_EXEC = SQLCall(hE1QueryInsert, "");
SQLQueryDispose(hE1QueryInsert);
IF FB_SQL_EXEC <> -1 THEN
ErrLog("Sucess insert data");
ELSE
ErrLog("Error message: " + SQLErrMsg(hE1QueryInsert));
END
SQLDisconnect(hSQL);
ELSE
ErrLog("Connection Error. Error Message: " + SQLErrMsg(hSQL));
END
When I start Vijeo Citect Runtime, the script works fine, but after time, stop to insert data into SQL Server and a message log into syslog.report is generated:"Connection Error. Error Message: SQL Error (13 - Too many connections created) on Handle (-1). Too many existing connections"
Could you help me?!
Best Regards,
Junior
I'm work with Vijeo Citect 7.4, and I have a connection with SQL Server by ODBC.
Bellow, my string to insert data into SQL Server:
hSQL=SQLConnect("DSN=ODBCNAME;UID=user;PWD=password")
IF hSQL <> -1 THEN
hE1QueryInsert = SQLQueryCreate(hSQL);
SQLSet(hE1QueryInsert, "INSERT IGNORE INTO Table");
SQLAppend(hE1QueryInsert, "(Col1, Col2)");
SQLAppend(hE1QueryInsert, " values (?,?)");
SQLParamsClearAll(hE1QueryInsert);
SQLParamsSetAsInt(hE1QueryInsert, "Col1", iCol1);
SQLParamsSetAsInt(hE1QueryInsert, "Col2", iCol2);
FB_SQL_EXEC = SQLCall(hE1QueryInsert, "");
SQLQueryDispose(hE1QueryInsert);
IF FB_SQL_EXEC <> -1 THEN
ErrLog("Sucess insert data");
ELSE
ErrLog("Error message: " + SQLErrMsg(hE1QueryInsert));
END
SQLDisconnect(hSQL);
ELSE
ErrLog("Connection Error. Error Message: " + SQLErrMsg(hSQL));
END
When I start Vijeo Citect Runtime, the script works fine, but after time, stop to insert data into SQL Server and a message log into syslog.report is generated:"Connection Error. Error Message: SQL Error (13 - Too many connections created) on Handle (-1). Too many existing connections"
Could you help me?!
Best Regards,
Junior