1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| unit UTCA2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, UTCA, OleServer, AccessXP, StdCtrls;
type
TForm1 = class(TForm)
AccessApplication1: TAccessApplication;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Déclarations privées }
public
{ Déclarations publiques }
var
Madatabase:olevariant;
MonForm:olevariant;
MonControle:OleVariant;
MaSection:OleVariant;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
AccessApplication1.CloseCurrentDatabase;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
AccessApplication1:=TAccessApplication.Create(self);
Madatabase:='H:\DATA\Test_Controle_Access.mdb';
AccessApplication1.OpenCurrentDatabase( Madatabase,false,'');
AccessApplication1.Visible:=true;
MonForm:='Form1';
AccessApplication1.CreateForm(Madatabase,MonForm);
MonControle:=acTextBox;
MaSection:=acDetail;
AccessApplication1.CreateControl(MonForm,MonControle,MaSection);
end;
end. |
Partager