mainfrm.pas
上传用户:psxgmh
上传日期:2013-04-08
资源大小:15112k
文件大小:1k
- unit mainfrm;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, StdCtrls, DB, DBTables, Grids, DBGrids;
- type
- TForm1 = class(TForm)
- StoredProc1: TStoredProc;
- Button1: TButton;
- Database1: TDatabase;
- edtClassNo: TEdit;
- edtClassName: TEdit;
- edtMemo: TEdit;
- Button2: TButton;
- DataSource1: TDataSource;
- DBGrid1: TDBGrid;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- with storedProc1 do
- begin
- paramByName('@aClassNo').AsString := edtClassNo.Text;
- paramByName('@aClassName').AsString := edtClassName.Text;
- paramByName('@aMemo').AsString := edtMemo.Text;
- ExecProc;
- end;
- end;
- procedure TForm1.Button2Click(Sender: TObject);
- begin
- with StoredProc1 do
- begin
- paramByName('@aClassNo').AsString := '001';
- Open;
- end;
- end;
- end.