Incorrect parameter length in version 4.45.13

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
tomazl
Posts: 3
Joined: Mon 08 Dec 2008 09:55

Incorrect parameter length in version 4.45.13

Post by tomazl » Mon 08 Dec 2008 13:09

After installing DBX driver version 4.45.13, some of my queries stoped to work. For example, when using TSimpleDataSet and setting it like this:

Code: Select all

with SP1 do
begin
    Close;
    DataSet.CommandType := ctQuery;
    DataSet.CommandText :=
      'SELECT   * ' +
      'FROM     MyTable ' +
      'WHERE    (Par1 = :parInt1)';
    DataSet.Params.ParamByName('parInt1').Value := 'IZP0026';
    Open;
end;
... the parameter length is incorrectly calculated (as VARCHAR(16), but actually 7). By checking with SQL Profiler, I got the following:

--v4.45.13
exec sp_executesql
N'SELECT *
FROM "MyTable"
WHERE (Par1 = @P1)',
N'@P1 varchar(16)', 'IZP0026 iň ôü| '

--v4.45.12
exec sp_executesql
N'SELECT *
FROM "MyTable"
WHERE (Par1 = @P1)',
N'@P1 varchar(7)', 'IZP0026'

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Tue 09 Dec 2008 14:06

I could not reproduce the problem.
Please send me a complete small sample at dmitryg*devart*com to demonstrate it, including a script to create and fill table.

Also supply me the following information:
- the exact version of your IDE;
- the exact version of SQL server and client.

Post Reply