[Qt-interest] QODBC + datatype binding problems

Mikhail Veygman mveygman at gmail.com
Tue Dec 1 20:51:43 CET 2009


Hi.

I am trying to use QODBC to connecting to MS SQL Server to write some
values to a table and there seems to be a problem with doing so when I
try binding QStrings/ByteArrays/Char * to a variable that is represented
as varchar in the database.

create table test_tbl
(
    code int NOT NULL,
    months varchar(63) NULL,
    config_info varchar(511) NULL,
    exclude_info varchar(511) NULL
) on test_tbl;

the query itself is:

insert into test_tbl(code, months) values (?, ?)

If I bind only code the insert is successful.  If I bind months,
config_info, or exclude_info I get:

QODBCResult::exec: unable to bind variable: "  [FreeTDS][SQL
Server]Invalid data type" 

Does anyone have any other ideas for me to try?


-- 
Regards,

Mikhail Veygman





More information about the Qt-interest-old mailing list