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

📄 queform.pas

📁 source code for the Marco Cantu s book Delphi 2009 Handbook
💻 PAS
字号:
unit QueForm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Db, StdCtrls, Grids, DBGrids, DBClient;

type
  TFormQuery = class(TForm)
    cdsQuery: TClientDataSet;
    DBGrid1: TDBGrid;
    btnParam: TButton;
    DataSource1: TDataSource;
    Label1: TLabel;
    ComboBox1: TComboBox;
    procedure btnParamClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormQuery: TFormQuery;

implementation

uses ThinForm;

{$R *.DFM}

procedure TFormQuery.btnParamClick(Sender: TObject);
begin
  cdsQuery.Close;
  cdsQuery.Params[0].AsString := ComboBox1.Text;
  cdsQuery.Open;
  Caption := 'Data sent at ' + TimeToStr (
    TDateTime (cdsQuery.GetOptionalParam('Time')));
  Label1.Caption := 'Param ' +
    cdsQuery.GetOptionalParam('Param');
end;

end.

⌨️ 快捷键说明

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