ADODataSet deleting from joined table

后端 未结 2 355
生来不讨喜
生来不讨喜 2021-01-03 02:42

I have a Delphi app where I display a list of games that have been played from a query like this:

select  g.*, gt.id, gt.descr 
from GAMES g 
inner join game         


        
相关标签:
2条回答
  • 2021-01-03 02:52

    You need to set TADODataset's "Unique Table" property after opening your dataset.

    ADODataset.Properties['Unique Table'].Value := 'GAMES';
    
    0 讨论(0)
  • 2021-01-03 03:07

    You need to use the Unique Table dynamic property

    ADOQuery1.Properties['Unique Table'].Value := 'GAMES';
    

    From the MSDN ADO Documentation

    If the Unique Table dynamic property is set, and the Recordset is the result of executing a JOIN operation on multiple tables, then the Delete method will only delete rows from the table named in the Unique Table property.

    0 讨论(0)
提交回复
热议问题