How to Pass External Values to Parameters of TMSUpdateSQL component

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Balaji
Posts: 20
Joined: Thu 05 Oct 2006 04:45

How to Pass External Values to Parameters of TMSUpdateSQL component

Post by Balaji » Tue 28 Nov 2006 15:38

Hi,

I am using Liecensed Version of SDAC components.

I have Query Component and in the SQL property of it i have "Select" statement. Using this Select i am selecting 5 Columns Unique Values. For the UpdateObject property of the Query Component i have a TMsUpdateSQL component attached. In this TMsUpdateSQL component i have insert statement, which will insert a row in to table having 7 Columns. Of these 7 Columns, 5 Columns values can be obtained by Opening the Query component i.e setting the Query.open. For the remaining two columns i want to set the values from Code.

I want to know, how to pass values to parameters of TMsUpdateSQL component using SDAC components. is there anything like parambyname property which can be used to pass parameters to TMsUpdateSQL compoenent?

Note: I cannot use SQLInsert bcos SQLInsert has a limitatation of "Parameter names should be same".


If u can explain me using an example, it will be help ful to me.

Thanks in Advance.

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Wed 29 Nov 2006 10:24

You can use TCustomDADataSet.BeforeUpdateExecute event to set parameters of corresponding statements.
What limitation do you mean? The behaviour of the TMSUpdateSQL component and the SQLInsert property is the same.

Post Reply