ADOQuery 和 DBNavigator
好的。我有简单的数据库、DBGrid 和 DBNavigator 。我将此代码用于我的 adoquery 并在我的 DBGrid 中查看此内容,
从 Table1 中选择 Count(*)As 1 , 2 3 按 1, 2 分组
问题是,如果我有两篇或多篇来自 1 的相同文章,并且我尝试从 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 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想以通常的方式使用 DBNavigator 是不可能的(不覆盖删除按钮事件),因为数据集在 DBGrid 行中保存多个记录,恕我直言,如果您在一组中有数据,网格不会关心。我想说,如果您选择一些分组行并尝试删除它,“DBNavigator”会检查一行是否有某个主(唯一)键,但在这种情况下,没有。
但这只是我的想法,现在无法验证。
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.