adotable.post 的问题
我在用ADOTABLE 操作的过程中,用APPEND,正常,可是只要一POST,就报错,错误提示如下
project prj.exe raised exception class eoleexception with message' 多步操作产生错误。请检查每一步的状态值。'
那位高手能指点一下啊?
代码如下unit Unit_input;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, twEnter, Grids, DBGridEh, StdCtrls, DBCtrls, Mask,
DBCtrlsEh, Menus, DB, Buttons, ImgList;
type
TFrminput = class(TForm)
panelbotton: TPanel;
Paneltop: TPanel;
TWEnter1: TTWEnter;
DBGridEh1: TDBGridEh;
DBE_no: TDBEditEh;
DBE_yinfu: TDBEditEh;
DBE_shifu: TDBEditEh;
DBTweifu: TDBText;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
BtnOk: TButton;
Splitter1: TSplitter;
dsinput: TDataSource;
Button1: TButton;
btnnew: TButton;
Label5: TLabel;
DBNavigator1: TDBNavigator;
SpeedButton1: TSpeedButton;
DBE_weifu: TDBEditEh;
procedure DBE_shifuExit(Sender: TObject);
procedure BtnOkClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure btnnewClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
suser:string;
{ Public declarations }
end;
var
Frminput: TFrminput;
implementation
uses Unit_data, Unit_login;
{$R *.dfm}
procedure TFrminput.DBE_shifuExit(Sender: TObject);
begin
{if StrToCurr(dbe_yinfu.Text) - StrToCurr(DBEshifu.Text) > 0 then
begin
DBTweifu.font.Color:=clred;
DBTweifu.font.Size:=10;
DMmain.ADTinput.FieldByName('zhaohui').AsCurrency:=StrToCurr(dbe_yinfu.Text) - StrToCurr(DBEshifu.Text);
end
else
DMmain.ADTinput.FieldByName('zhaohui').AsCurrency:=0 ; }
end;
procedure TFrminput.BtnOkClick(Sender: TObject);
begin
DMmain.adtinput.Post;
end;
procedure TFrminput.Button1Click(Sender: TObject);
begin
label1.Caption:=suser;
end;
procedure TFrminput.btnnewClick(Sender: TObject);
begin
DMmain.adtinput.Edit;
DMmain.adtinput.Append;
DMmain.adtinput.FieldByName('caozuoyuan').AsString:=FrmLogin.suser;
end;
procedure TFrminput.FormCreate(Sender: TObject);
begin
frminput.WindowState:=wsmaximized;
if not DMmain.ADTinput.Active =True then
DMmain.ADTinput.Active:= true;
end;
end.
project prj.exe raised exception class eoleexception with message' 多步操作产生错误。请检查每一步的状态值。'
那位高手能指点一下啊?
代码如下unit Unit_input;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, twEnter, Grids, DBGridEh, StdCtrls, DBCtrls, Mask,
DBCtrlsEh, Menus, DB, Buttons, ImgList;
type
TFrminput = class(TForm)
panelbotton: TPanel;
Paneltop: TPanel;
TWEnter1: TTWEnter;
DBGridEh1: TDBGridEh;
DBE_no: TDBEditEh;
DBE_yinfu: TDBEditEh;
DBE_shifu: TDBEditEh;
DBTweifu: TDBText;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
BtnOk: TButton;
Splitter1: TSplitter;
dsinput: TDataSource;
Button1: TButton;
btnnew: TButton;
Label5: TLabel;
DBNavigator1: TDBNavigator;
SpeedButton1: TSpeedButton;
DBE_weifu: TDBEditEh;
procedure DBE_shifuExit(Sender: TObject);
procedure BtnOkClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure btnnewClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
suser:string;
{ Public declarations }
end;
var
Frminput: TFrminput;
implementation
uses Unit_data, Unit_login;
{$R *.dfm}
procedure TFrminput.DBE_shifuExit(Sender: TObject);
begin
{if StrToCurr(dbe_yinfu.Text) - StrToCurr(DBEshifu.Text) > 0 then
begin
DBTweifu.font.Color:=clred;
DBTweifu.font.Size:=10;
DMmain.ADTinput.FieldByName('zhaohui').AsCurrency:=StrToCurr(dbe_yinfu.Text) - StrToCurr(DBEshifu.Text);
end
else
DMmain.ADTinput.FieldByName('zhaohui').AsCurrency:=0 ; }
end;
procedure TFrminput.BtnOkClick(Sender: TObject);
begin
DMmain.adtinput.Post;
end;
procedure TFrminput.Button1Click(Sender: TObject);
begin
label1.Caption:=suser;
end;
procedure TFrminput.btnnewClick(Sender: TObject);
begin
DMmain.adtinput.Edit;
DMmain.adtinput.Append;
DMmain.adtinput.FieldByName('caozuoyuan').AsString:=FrmLogin.suser;
end;
procedure TFrminput.FormCreate(Sender: TObject);
begin
frminput.WindowState:=wsmaximized;
if not DMmain.ADTinput.Active =True then
DMmain.ADTinput.Active:= true;
end;
end.
...全文
相关推荐
delphi的一个简单增删改查操作
例如,使用ADODataset的Execute方法执行INSERT或UPDATE,或者使用ADOTable的Append、Edit、Post方法进行添加和修改记录。
delphi对access的多表多字段的查询实例
你可以通过其Field对象访问特定字段,或者使用其Edit、Post、Cancel等方法进行数据操作。6.
程序主要演示ADOTable立即提交與批量提交的使用方法
.BatchSize) or (ADOTable1.State = dsEdit) then begin ADOTable1.Post; // 提交更改 BatchCount := 0; end; finally
访问MS SQL Server Image类型数据的一种简便方法.pdf
在开发GIS(地理信息系统)或其他需要处理图像信息的应用时,如何便捷地读写Image类型的字段是一个重要的问题。
在Delphi中连接数据库
记录导航:ADOQuery提供RecordCount属性获取记录总数,Eof属性检查是否到达记录集末尾,First、Next、Previous和Last方法用于移动记录指针,Append、Edit和Post


数据库相关
