ApplyUpdates(0)保存数据时报unable to find record! no key specified!

hg_delphi 2011-12-09 03:29:23
datasetprovider 的updatemode 为 upWhereAll,resolvetodataset为false,
修改clientdataset数据,并applyupdates(0),就报unable to find record! no key specified! 这个错误,不知什么原因,请高手指点 !
...全文
233 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
BambooCaep 2011-12-11
  • 打赏
  • 举报
回复
那就建一个自增长字段呗。
hg_delphi 2011-12-09
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 bamboocaep 的回复:]
建议不用upWhereAll,而用upWhereKeyOnly
[/Quote]

问题是我的表没有关键字段呀!
应该怎样设置pfInKey属性呀
kaikai_kk 2011-12-09
  • 打赏
  • 举报
回复
if clientdataset.ChangeCount>0 then
clientdataset.applyupdates(0);
BambooCaep 2011-12-09
  • 打赏
  • 举报
回复
updatemode 为 upWhereAll时,如果两条记录的内容一样,so......
BambooCaep 2011-12-09
  • 打赏
  • 举报
回复
建议不用upWhereAll,而用upWhereKeyOnly
BambooCaep 2011-12-09
  • 打赏
  • 举报
回复
需要一个内容唯一的字段,在其ProviderFlags里设置pfInKey。
Delphi 7.1 Update Release Notes=======================================================This file contains important supplemental and late-breakinginformation that may not appear in the main productdocumentation, and supersedes information contained in otherdocuments, including previously installed release notes.Borland recommends that you read this file in its entirety.NOTE: If you are updating a localized version of Delphi 7, visit the Borland Registered User web site to obtain a localized readme file that may contain important late- breaking information not included in this readme file.IMPORTANT: Delphi must be closed before installing this update. =====================================================CONTENTS * INSTALLING THIS UPDATE * UPDATING LOCALIZED VERSIONS OF DELPHI 7 * KNOWN ISSUES * ISSUES ADDRESSED BY THIS UPDATE - IDE - CORE DATABASE - DATASNAP - DBGO (ADO COMPONENTS) - dbExpress - dbExpress COMPONENTS AND DB VCL - dbExpress CORE DRIVER AND METADATA - dbExpress VENDOR ISSUES - dbExpress CERTIFICATION - WEB SNAP - ACTIVEX - COMPILER - RTL - VCL - THIRD PARTY - BOLD FOR DELPHI * VERIFYING THAT THE UPDATE WAS SUCCESSFUL * FILES INSTALLED BY THIS UPDATE =======================================================INSTALLING THIS UPDATE* This update can not be applied to Delphi 7 Architect Trial version. * This update can not be removed after it is installed.* You will need the original Delphi 7 installation CD available to install this update.* To install this update from the CD, insert the CD, and launch the d7_ent_upd1.exe file appropriate for your locale.* To install this update from the Web, double-click the self-executing installation file and follow the prompts. * The Delphi 7 documentation PDF files are available on the update CD.========================================================UPDATING LOCALIZED VERSIONS OF DELPHI 7* This update can be applied only to the English version of Delphi 7. There are separate updates for the German, French and Japanese ver

16,748

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧