DB Open Connection and Close Connection
Posted: Thu Dec 13, 2018 4:13 am
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);
}
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);
}