关于SimpleDataSet.ApplyUpdates出错的问题

crackatom 2004-11-25 09:50:17
procedure TForm1.Button1Click(Sender: TObject);
begin
SQLConnection1.Active:=true;
SimpleDataSet.Connection:=SQLConnection1;
SimpleDataSet.CommandType:=ctQuery;
SimpleDataSet.Active:=false;
SimpleDataSet.CommandText:='select * from TABLE';
SimpleDataSet.Active:=true;

SimpleDataSet.Append;
SimpleDataSet.Fields[0].Asstring:='0';
SimpleDataSet.Fields[1].Asstring:='1';
SimpleDataSet.post;

SimpleDataSet.ApplyUpdates(0); //数据库报错:SQL State 42000,Eror Code 544
end;
...全文
128 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
gechaosa 2004-11-25
  • 打赏
  • 举报
回复
SimpleDataSet.ApplyUpdates(-1); 试试,看看数据有没有增加;
crackatom 2004-11-25
  • 打赏
  • 举报
回复
Up
TaylorGao 2004-11-25
  • 打赏
  • 举报
回复
SQL Error Code 544:

当试图将包含特定标识值的行插入到包含标识列的表中时发生该错误。但是,指定表未启用 SET IDENTITY_INSERT。

一定是对标识值进行修改造成这种情况,只要不要对该字段进行修改,或者更改该字段的属性。

crackatom 2004-11-25
  • 打赏
  • 举报
回复
找到问题:是数据库结构有问题,更改后一切正常;
unit uMain; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Mask, RzEdit, RzButton, ExtCtrls, IniFiles, RzTabs, ComCtrls, RzListVw, RzShellCtrls, ImgList, RzShellDialogs, RzCmboBx, QRCtrls, QuickRpt, jpeg, ShlObj, RzPanel, RzSplit, RzTreeVw, DB, ADODB, Provider, DBClient, GridsEh, DBGridEh, RzStatus; type PShellItem = ^TShellItem; TShellItem = record FullID, ID: PItemIDList; Empty: Boolean; DisplayName, TypeName: string; ImageIndex, Size, Attributes: Integer; ModDate: string; end; TfrmMain = class(TForm) RzPageControl1: TRzPageControl; TabSheet1: TRzTabSheet; TabSheet2: TRzTabSheet; lbl1: TLabel; edt_Path1: TRzEdit; btn_o2: TButton; Button1: TButton; SplPreview: TRzSplitter; img1: TImage; RzToolbar1: TRzToolbar; RzSpacer1: TRzSpacer; ClientDS_PicCap: TClientDataSet; DataSP_PicCap: TDataSetProvider; Qry_PicCap: TADOQuery; Ds_PicCap: TDataSource; DBGridEh1: TDBGridEh; ClientDataSetH: TClientDataSet; DataSetProviderH: TDataSetProvider; QueryH: TADOQuery; DataSourceH: TDataSource; RzBtn_0: TRzBitBtn; RzBtn_1: TRzBitBtn; ImageList1: TImageList; Memo1: TMemo; ClientDS_PicCapacc_id_only: TStringField; ClientDS_PicCapname: TStringField; ClientDS_PicCapplate_num: TStringField; ClientDS_PicCapplate_type: TStringField; ClientDS_PicCapInsDate: TDateTimeField; ClientDS_PicCapAcc_ID_Only_1: TStringField; ClientDS_PicCapfDateTime: TDateTimeField; ClientDS_PicCapPicturePath1: TStringField; ClientDS_PicCapPicturePath2: TStringField; ClientDS_PicCapPicturePath3: TStringField; ClientDS_PicCapPicturePath4: TStringField; ClientDS_PicCapPicturePath5: TStringField; ClientDS_PicCapPicturePath6: TStringField; ClientDS_PicCapPicturePath7: TStringField; ClientDS_PicCapPrintCount: TIntegerField; ClientDataSetHAutoID: TAu
Delphi 2010 xe 补丁,解决了CientDataset在applyupdates时负数报错的问题 RAD Studio XE Hotfix for RAID 280864 This software patch is being provided to licensed users of Embarcadero RAD Studio XE. Installation and use are governed by the license statement for Embarcadero RAD Studio XE. This Hotfix applies to: Product: Embarcadero RAD Studio, Delphi, C++Builder Version: XE Update level: Update 1 Editions: Enterprise, Architect Languages: English, German, French, Japanese Description of updates that are included in this hotfix: Internal Tracking Number(s): 280864, QC 88928 This fix corrects the error caused when an application with a TClientDataSet and TProvider encounters a negative status code from a database server. Install instructions: 1. Make backup copies of the following files in your \\Program Files\Embarcadero\RAD Studio\8.0\ directory: lib\win32\debug\Provider.dcu lib\win32\release\Provider.dcu lib\win32\debug\dsnap.lib lib\win32\release\dsnap.lib source\db\Provider.pas 2. If localized library directories (de, fr or ja) exist under lib directory, backup the following files: lib\win32\debug\FR\dsnap.lib lib\win32\debug\JA\dsnap.lib lib\win32\debug\DE\dsnap.lib lib\win32\release\FR\dsnap.lib lib\win32\release\JA\dsnap.lib lib\win32\release\DE\dsnap.lib 3. Make backup copies of the following files in your \\Windows\System32 directory: dsnap150.bpl dsnap150.jdbg dsnap150.de (if German version) dsnap150.fr (if French version) dsnap150.ja (if Japanese version) 4. Place the RADStudioXEHF_280864.zip into the \\Program Files\Embarcadero\RAD Studio\8.0\ directory. 5. Extract the RADStudioXEHF_280864.zip. 6. Copy the extracted system32\dsnap150.* files to your \\Windows\System32 directory. Copyright 2011, Embarcadero Technologies. All rights reserved.
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

2,498

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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