Diman
Admin
 Admin
| Posts: 1460 |  | Karma: 18 |
|
Re:convert a project from BDE to thindac
|
|
Posted: 2007/11/04 23:22 |
|
|
|
|
Hello
There is no TTDUpdateSQL.
Instead you should add TTDSQLProcessor.OnGetUpdateSQL event handler. TTDSQLProcessor is server side requests processor, which converts client requests into SQL commands. In that event handler you will need to write something like that:
procedure TForm1.GetUpdateSQL(ASender: TObject;
AUpdateInfo: TTDUpdatesInfo; var ASQL: TTDString);
begin
if AUpdateInfo.UpdateObject = 'MyTab1' then
case AUpdateInfo.UpdateStatus of
usInserted: ASQL:= UpdateSQL1.InsertSQL.Text;
usModified: ASQL:= UpdateSQL1.UpdateSQL.Text;
usDeleted: ASQL:= UpdateSQL1.DeleteSQL.Text;
end
else if AUpdateInfo.UpdateObject = 'MyTab2' then
..........................
end;
|
There AUpdateInfo.UpdateObject is the value of TTDClientDataSet.UpdateOptions.UpdateTableName property. So, you can write there any value, which you can use at server side to distinguish datasets. AUpdateInfo.UpdateStatus is the update status of current update row request. If event handler will return empty ASQL, then will be generated default update SQL.
Regards,
Dmitry
|
|