Behavior of ftWideMemo Fields and Params changed from 7.1.3 to 7.3.12

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Nilss
Posts: 11
Joined: Thu 27 Jun 2013 12:23

Behavior of ftWideMemo Fields and Params changed from 7.1.3 to 7.3.12

Post by Nilss » Mon 05 Sep 2016 12:55

We recently upgraded from SDAC version 7.1.3 to 7.3.12.

Fields of type ftWideMemo seem to return an empty string for Value property. Formerly, if assigning

Code: Select all

Param.Value := Field.Value 
would not cause Param.IsNull to be False, this is now the case. When assigning

Code: Select all

Field2.Value := Field.Value
Field2.IsNull will be True. But when an update or insert statement is generated the corresponding parameter will have IsNull = False. This causes different different parameter assignment for us, instead of being NULL they are filled with empty strings.

Is this an intentional change or an error?

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Behavior of ftWideMemo Fields and Params changed from 7.1.3 to 7.3.12

Post by azyk » Fri 09 Sep 2016 12:21

Thank you for the information. We have reproduced the described behavior and are investigating it. We will inform you about the results.

Nilss
Posts: 11
Joined: Thu 27 Jun 2013 12:23

Re: Behavior of ftWideMemo Fields and Params changed from 7.1.3 to 7.3.12

Post by Nilss » Mon 27 Feb 2017 13:21

Is there any update on this?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Behavior of ftWideMemo Fields and Params changed from 7.1.3 to 7.3.12

Post by ViktorV » Tue 28 Feb 2017 07:20

Yes, you are right, we changed SDAC 7.3.12 behaviour. Now when setting the TMSParam.Value property to an empty string the TMSParam.IsNull property will be set to False, as in SQL Server an empty string does not equal NULL. To set the NULL value in the parameter, you should call the Clear method, like this:
MsQuery.ParamByName('myParam').Clear;
To solve the issue you can use the following code:

Code: Select all

if Field.IsNull then
  Param.Clear
else
  Param.Value := Field.Value;

Post Reply