Applies To:
  • CitectSCADA 4.x

SQL functions will cause Citect to crash, or exit without a warning. This problem only occurs when you call SQLDisconnect, or DevClose using an SQL device, and are using the ODBC Manager version 2.5 and 3.0. Citect will crash with the following message:

The instruction at "0x040015c" referenced memory at "0x040015c1". The memory could not be "read".

Otherwise Citect will exit to the operating system without issuing an error message. Only SQL functions will give this type of error. If you are not using the SQL functions then you will not experience this problem. This problem occurs on both Windows NT4.0 and Windows 95, but is more common on Windows NT. The problem may also exist on Windows NT3.51, but has not been reported by any Citect customers at this point.


This is a problem with the Microsoft ODBC Drivers. Download the file Msjtwng.exe from the Microsoft WWW site. This file will self-extract on execution. Read the Readme.txt file and follow the installation instructions for Msjt3032.dll. The other DLLs in the pack should only be replaced if they exist on your system.

To download the file from the Microsoft WWW site select the search option from the first page. Search for the knowledge base article Q156298, searching the site, in the Product Support Services category. Follow the links in this article to download the file.

The previous workaround for this problem was to implement a Cicode function as part of the Citect startup process. If this function was previously implemented it should be removed.

This is the old solution to this problem and should be removed from your Citect project

This is a problem with the Microsoft ODBC Drivers and is currently being investigated by Microsoft. As an interim solution, use the following Cicode function to work around the problem:

   INT hDLLFunc;

   hDLLFunc = DLLOpen("KERNEL32.DLL", "LoadLibraryA", "JC");
   IF hDLLFunc <> -1 THEN
      DLLCall(hDLLFunc, "MSJT3032.DLL");
      ErrLog("SQL Fix: 7983 for Microsoft ODBC Driver Bug");

This function should be called in a Startup function before any any other SQL or Device commands. If problems are still experienced after the function has been called, check to make sure that no other SQL or Device commands are called before it.

Once a fix is received, this function should be removed from the project.