简体   繁体   中英

ADOQuery and DBNavigator

OK. I have simple Database ,DBGrid and DBNavigator . I use this code for my adoquery and view in this in my DBGrid

select Count(*)As 1 , 2 3 from Table1 Group by 1, 2

The problem is that if i have two or more the same article from 1 and i try to delete it from DBnavigator it send me

Key column information is insufficient or incorrect.Too many rows were affected by update. I want to delete two or more rows.Not only one. How to fix that ?

I guess it won't be possible using DBNavigator in a usual way (without override delete button event), because the dataset holds more than one record in a DBGrid row and IMHO the grid doesn't take care if you have data in a group. I would say if you select some grouped row and try to delete it, "DBNavigator" checks if there is some primary (unique) key for a row, but in this case, there is no one.

But it's just my notion, I can't verify it now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM