下面是我全部的代码:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, StdCtrls, Mask, DBCtrls, wwdbedit, Grids, Wwdbigrd,
Wwdbgrid, Menus, ExtCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
ADOConnection1: TADOConnection;
GroupBox1: TGroupBox;
Label2: TLabel;
Label1: TLabel;
Label3: TLabel;
Edit7: TEdit;
Edit8: TEdit;
Edit9: TEdit;
GroupBox2: TGroupBox;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Edit13: TEdit;
Edit14: TEdit;
Edit15: TEdit;
Button5: TButton;
Button6: TButton;
wwDBEdit10: TwwDBEdit;
MainMenu1: TMainMenu;
N1: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
procedure Button2Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure N4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
//进货单下表更新
----------------------------这段代码更新数据更新步了-----------------------------------------
procedure TForm1.Button2Click(Sender: TObject);
var
sSQL1: String;
begin
begin
if (trim(Edit2.Text) <> '') or (trim(Edit2.Text) <>'')or(trim(Edit2.Text)<>'') then
sSQL1 :='update ANT SET VEN=''' + Edit2.Text + ''',CUR=''' + Edit3.Text + ''' WHERE PANNO=''' + Edit1.Text + '''';
ADOConnection1.Execute(sSQL1);
ShowMessage('上表更新完成');
end;
end;
-----------------------------这段代码更新数据更新步了---------------------------
//采购订单下表更新
procedure TForm1.Button6Click(Sender: TObject);
var
sSQL3: String;
begin
if (trim(Edit13.Text) <> '') or (trim(Edit14.Text) <>'')or(trim(Edit15.Text)<>'') then
begin
sSQL3 :='UPDATE POT SET VEN=''' + Edit14.Text + ''',CUR=''' + Edit13.Text + ''' WHERE PORNO=''' + Edit15.Text + '''';
ADOConnection1.Execute(sSQL3);
ShowMessage('下表更新完成');