Applies To:
  • CitectSCADA 4.xx, 5.xx

When using the Microsoft dBase Driver with cicode SQL functions, an error may occur on a call to SQLExec() after several repetitions of the sequence SQLConnect(), SQLExec(), SQLEnd() and SQLDisconnect(). When SQLErrMsg() is used to determine the error, the error message is as follows:

-1011 [Microsoft][ODBC dBase Driver] System resource exceeded.

Also it has been found that when repeats of the above sequence are used with some ODBC drivers such as the Microsoft dBase driver, Microsoft Paradox driver or the Microsoft Excel driver there is a handle and/or memory resource leakage with each iteration of the sequence.


See also Knowledge Base article Q2993. The problem exists in a third party library used by Citect for ODBC. A workaround has been found which counters both problems described. The workaround is to only call SQLConnect() and SQLDisconnect() when it is really necessary. Ideally SQLConnect() should only be called when Citect starts up and SQLDisconnect() called when Citect shuts down. It may be necessary under some error conditions to call SQLDisconnect() and then re-establish the connection with SQLConnect(). This should be OK. Testing of this problem with several database drivers also suggests the resource leakage problem is removed or greatly reduced if at least one database connection to each driver being used, is always kept open until shutdown. For example by connecting to the target database or even a dummy database at startup, then it has been found that repeats of the function sequence described above do not have a major impact on handle or memory resources. Calls to SQLConnect() after this first connection have also been found to take less time. 

CIT has confirmed this to be a problem in Citect for Windows version 5.xx and 4.xx. We are researching this problem and will post new information here as it becomes available.