OpenSchemaU1.pas
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:1k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit OpenSchemaU1;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, StdCtrls, ExtCtrls, DB, ADODB, Grids, DBGrids;
  6. type
  7.   TForm1 = class(TForm)
  8.     DBGrid1: TDBGrid;
  9.     ADOConnection1: TADOConnection;
  10.     DataSource1: TDataSource;
  11.     ADODataSet1: TADODataSet;
  12.     Panel1: TPanel;
  13.     Button1: TButton;
  14.     Button2: TButton;
  15.     procedure Button1Click(Sender: TObject);
  16.     procedure Button2Click(Sender: TObject);
  17.   private
  18.     { Private declarations }
  19.   public
  20.     { Public declarations }
  21.   end;
  22. var
  23.   Form1: TForm1;
  24. implementation
  25. {$R *.dfm}
  26. procedure TForm1.Button1Click(Sender: TObject);
  27. begin
  28.   ADOConnection1.OpenSchema(siPrimaryKeys, EmptyParam, EmptyParam, ADODataSet1);
  29. end;
  30. procedure TForm1.Button2Click(Sender: TObject);
  31. var
  32.   Filter: OLEVariant;
  33. begin
  34.   Filter:=VarArrayCreate([0, 2], varVariant);
  35.   Filter[2]:='CUSTOMERS';
  36.   ADOConnection1.OpenSchema(siPrimaryKeys, Filter, EmptyParam, ADODataSet1);
  37. end;
  38. end.