adotable.post 的问题
bfox 2003-12-12 09:48:28 我在用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.