TCustomMSDataSet provides wrong field value to parameter

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

TCustomMSDataSet provides wrong field value to parameter

Post by Nilss » Tue 10 Mar 2020 16:38

Hi,

we recently updated from SDAC 8.0.4 to 9.1.2 and now found a situation where the provided value from a field in a TCustomMSDataSet to a parameter of an insert statement changed.

The TCustomMSDataSet in question is a TMSStoredProc with a select statement that is similar to this abstracted example:

Code: Select all

SELECT
     t3.Value AS [V]
    ,t.Value AS [V_Compare_]
FROM dbo.Table t
OUTER APPLY
(
    SELECT
         t.V AS V
    UNION ALL 
    SELECT 
         t2.V
    FROM dbo.Table_2 t2
) t3
We assigned statement for insert using a stored procedure call, so no generated SQL, with a parameter "V". It used to get the value assigned from the name matching "V" field in the dataset, but since the update it gets the value of "V_Compare_". I've investigated and realized that this is caused by a change to TDADataSetUpdate.FieldByParamName, added inner function FindFieldByParamName, which will now find another field based on meta data.

Is this working as intended? Is there any way around this additional matching behavior to basically get back the behavior prior to the upgrade?

Stellar
Devart Team
Posts: 347
Joined: Tue 03 Oct 2017 11:00

Re: TCustomMSDataSet provides wrong field value to parameter

Post by Stellar » Thu 12 Mar 2020 09:57

Thank you for the information. We fixed a similar issue earlier, and the fix was included in SDAC 9.1.3. Please check whether the issue occurs in the SDAC 9.1.3. If it does, please send us a small example demonstrating the issue. You can send it through the contact form on our website: devart.com/company/contactform.html
The new version 9.1.3 of SDAC is already available for download.

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

Re: TCustomMSDataSet provides wrong field value to parameter

Post by Nilss » Thu 12 Mar 2020 17:04

Thank you for the reply. I checked with version 9.1.3 and the issue is gone indeed!

Stellar
Devart Team
Posts: 347
Joined: Tue 03 Oct 2017 11:00

Re: TCustomMSDataSet provides wrong field value to parameter

Post by Stellar » Fri 13 Mar 2020 07:06

Glad to see that the issue was resolved.
Feel free to contact us if you have any further questions about our products.

Post Reply