⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 execprocedure.pas

📁 《delphi数据库设计与实例开发》随书光盘
💻 PAS
字号:
unit ExecProcedure;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, DBTables, ExtCtrls, TeeProcs, TeEngine, Chart, StdCtrls,
  Grids, DBGrids;

type
  TForm1 = class(TForm)
    DBGrid1: TDBGrid;
    Label1: TLabel;
    Button1: TButton;
    ComboBox1: TComboBox;
    DataSource1: TDataSource;
    StoredProc1: TStoredProc;
    Label2: TLabel;
    Label3: TLabel;
    Database1: TDatabase;
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(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
   close;
   ParamByName('@type').AsString:=Combobox1.Text;
   Prepare;
   Open;
   close;
   ParamByName('@type').AsString:=Combobox1.Text;
   Prepare;
   ExecProc;
   Label3.Caption:=InttoStr(ParamByName('@ytd_sales').Asinteger);
   close;
   ParamByName('@type').AsString:=Combobox1.Text;
   Prepare;
   Open;
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
	try
	  DataBase1.Open;
	Except
	  On E:EdatabaseError do
	  ShowMessage(E.Message);
	end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -