ODBC SQL Server Error

I have a web application that connects to a database hosted on SQL Server via ODBC.

With Xojo 2014r2 everytime i try to insert a new record with

InsertRecord (“Table”, rec)

i get an error “[SQL Server Native Client 10.0]String data, right truncation.” and the record is not inserted in the database.

If i open the same project with Xojo 2014r1.1 when i run the application the InsertRecord is executed without errors.

Any ideas ?

Thanks in advance

The only time I’ve seen that error is when the data you’re entering is wider than the field length. What’s the definition of the field you are inserting to?

The field is nvarchar(255). And the data that i try to put into the field is smaller.

In another case, i try to remove from the InsertRecord statement all the string fields, leaving only one integer field, but i get this error.

[Microsoft][SQL Server Native Client 10.0]Invalid character value for cast specification

However, with Xojo 2014r1.1 everything works good.

Do you also get these errors if you you use SQLExecute?

If i use SQLExecute of a “INSERT INTO table …” everything goes in the right way and the record is created successfully.
In this moment i have substituted all the InsertRecord blocks with equivalent “INSERT INTO” commands that runs through SQLExecute.
The recordset.Edit and recordset.Update works correctly as before.

Please check the ODBC interface with SQLserver for InsertRecord, the same project that gives me problems with Web Essentials Widgets continues to worry me because i have a lot of InsertRecord. I could transform each in a “INSERT INTO” SQL statemente but it wil take a lot of time.

I’m working on a Italian Windows 7 Professional N - 64 Bit - ODBC 32 bit configured with a database hosted on the same computer in SQL server 2008 R2 Express 10.50.2500.

With 2014 r1.1 everything goes well.
With 2014 r2 InsertRecord gives that error.

I have found a little but very useful program that traces all the commands that arrives to MS SQL Express.
You can download it from https://expressprofiler.codeplex.com/.

I have extracted from the log the lines that the program detect when i run the web application.

if you want you can download the Excel file containing the log from

The first part is the log of the sql server when i run the web application with XOJO 2014 r1.1.

The second parth is the log of the sql server when i run the web application with XOJO 2014 r2.

The app is trying to insert into a table called “WebAccessi” the data from the user and browser config. After that the app shows data for the user.