TMSUpdateSQL

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jfpicard
Posts: 24
Joined: Tue 06 Dec 2005 21:17

TMSUpdateSQL

Post by jfpicard » Fri 16 Dec 2005 14:45

Got a little conversion question here.

With the TUpdateSQL I was able to set parameters in the 'Query' for the update with the following code :

Usql.Query[ukInsert].ParamByName('test').AsString := SubStr;

With the TMSUpdateSQL, the Query property doesn't exist. So that code doesn't work. There is the SQL property, but it's only TStrings. Am I missing something ?

Thanks.

Jean-François Picard

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 19 Dec 2005 09:32

SDAC doesn't provide such functionality.

Yet more correct and easier it would be not to use TMSQupdateSQL. If there is a unique key field in a table, SDAC SQL Generator creates update queries automatically.

jfpicard
Posts: 24
Joined: Tue 06 Dec 2005 21:17

Post by jfpicard » Wed 21 Dec 2005 17:47

But when you want to add a Foreign key into your query to update the table, a TUpdateSQL is very usefull.

We always doing something like:

usqltest.Query[UpdateKind].ParamByName('IDFK').AsString := qry.FieldByName('ID').AsString;

With usqltest bind to the qrytest fo example. For simple update, we don't use any TUpdateSQL.

Thanks.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 23 Dec 2005 13:45

> Use MSQuery.BeforeUpdateExecute event to set proper parameter's properties.

Post Reply