string SqlPath = "DSN=ORA;UID=TEST;PWD=TEST1234;";
I would like to 'dbOpenConnection' in Main() and 'dbCloseConnection' when WINCCOA itself is shutting down.
1. Where do I use 'dbCloseConnection' tp achieve this?
2. Is there a way to check the status of the dbConnection variable Open and Close?
The following script runs more than 100,000 times a day, so there is a great load on the Oracle server as for every "dbOpenConnection" a "dbCloseConnection is looped for every single operation.
bool SQL WORK(string SqlPath,dbConnnection &Local_db) {
int nResult = 0;
//SQL OPEN
nResult = dbOpenConnection(SqlPath, Local_db);
////WORK
////WORK
//SQL CLOSE
dbCloseConnection (Local_db);
}
DB Open Connection and Close Connection
Search
Re: DB Open Connection and Close Connection
I'd say you don't need to close the connection explicitely since it will be done automatically when the CTRL manager stops the script.
However if you like to do any other task when the CTRL manager shuts down, then - with 3.16 - you can register a callback
with sysConnect("callback", "exitRequested");
However if you like to do any other task when the CTRL manager shuts down, then - with 3.16 - you can register a callback
with sysConnect("callback", "exitRequested");