Applies To:
  • CitectSCADA 5.xx, 6.XX
  • CitectHMI 5.xx, 6.XX

Summary:
DevOpen() returns error 307 this indicates an SQL error.  Calling SQLErrMsg() immediately after the DevOpen() returns the following error string

4149 [Microsoft][ODBC Driver Manager] Program type out of range.
 

Solution:
The reason for this is the data types in the SQL table.  Citect’s database functions only read and write string data. Also Citect does not support Unicode strings. This error typically occurs due to Unicode data types in the database table.

If you change the following Unicode types:

nvchar
nvarchar
ntext

to the following Non-Unicode types:

char
varchar
text

then this problem should resolve.

(Note: The error occurs on opening the device because DevOpen() causes a SELECT * FROM <tablename> to occur to determine what fields are available in the database. This can cause other performance issues when dealing with large tables)
 

Keywords:
ODBC error SQL 307 4149 DevOpen  

Attachments