var
Form1:TForm;
t:TDBGrid;
b1,b2: TButton;
Query1:tquery;
DataSource1:tdatasource;




procedure Button1Click(Sender: TButton);
begin
ShowMessage('Ñîîáùåíèå');

end;


procedure Button2Click(Sender: TButton);
begin
Form1.close;
end;


begin
     Form1 := TForm.Create(nil);
     DataSource1 := Tdatasource.Create(Form1);
     Query1 := Tquery.Create(Form1);
     b1 := Tbutton.Create(Form1);
     b2 := Tbutton.Create(Form1);




 Form1.caption:='Íîâûé îò÷åò';
 Form1.SetBounds(50, 50, 750, 525);
 t := TDBGrid.Create(Form1);
 t.Parent := Form1;
 t.SetBounds(10, 30, 720, 400);

  b1.Name := 'svButton1';
  b1.Parent := Form1;
  b1.caption := 'Ñîîáùåíèå';
  b1.SetBounds(400, 440, 75, 25);
  b1.OnClick := 'Button1Click' ;

  b2.Name := 'svButton2';
  b2.Parent := Form1;
  b2.caption := 'Çàêðûòü';
  b2.SetBounds(480, 440, 75, 25);
  b2.OnClick := 'Button2Click' ;





 Form1.Show;

DataSource1.dataset:=Query1;

Query1.Name := 'svq';
Query1.databasename:='dbkassa';

t.datasource:=DataSource1;
Query1.close;
Query1.sql.clear;
Query1.sql.add('select name, ostat from tovar.db');
Query1.open;
end.
