Why Uniquery.ApplyUpdates not successful?
Posted: Tue 07 Jan 2014 16:03
when I put Uniquery,UniDataSource,UniUpdateSQL on a Form.
Set properties like this:
UniDataSource.DataSet := UniQuery;
UniQuery.UpdateObject := UniUpdateSQL;
//and I generate UniUpdateSQL insert\Update\Delete SQL Code on the form;
I define UniQuery.AfterpPost event Code like this:
UniQuyer.ApplyUpdates;
I define UniQuery.AfterDelete event Code like this:
UniQuyer.ApplyUpdates;
but when I wrote this code to Insert or Delete records,Insert is successful,but Delete is not successful.
UniQuery.Close;
UniQuery.Open;
UniQuery.Insert;
UniQuery.FieldByName('TEST').Asstring := 'AAAA'; //Key Filed
...
UniQuery.Post; //the record was be inserted to MSSQL sucessful;
//then i run this
UniQuery.Delete; //the record 'AAAA' can not be Deleteed,and i user sql server profile,
//can not trace any SQL CODE
Can you help me how to solve this problem?
Thanks a lot.
Set properties like this:
UniDataSource.DataSet := UniQuery;
UniQuery.UpdateObject := UniUpdateSQL;
//and I generate UniUpdateSQL insert\Update\Delete SQL Code on the form;
I define UniQuery.AfterpPost event Code like this:
UniQuyer.ApplyUpdates;
I define UniQuery.AfterDelete event Code like this:
UniQuyer.ApplyUpdates;
but when I wrote this code to Insert or Delete records,Insert is successful,but Delete is not successful.
UniQuery.Close;
UniQuery.Open;
UniQuery.Insert;
UniQuery.FieldByName('TEST').Asstring := 'AAAA'; //Key Filed
...
UniQuery.Post; //the record was be inserted to MSSQL sucessful;
//then i run this
UniQuery.Delete; //the record 'AAAA' can not be Deleteed,and i user sql server profile,
//can not trace any SQL CODE
Can you help me how to solve this problem?
Thanks a lot.