Урок на Делфи 77. База даных BDE


задание на delphi. Базы данных - Borland Database Engine на делфи 10.

unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DB, Vcl.Grids, Vcl.DBGrids,
Data.Win.ADODB, Vcl.StdCtrls,Bde.DBTables,ComObj, Vcl.ExtCtrls, Vcl.DBCtrls;
type
TForm1 = class(TForm)
DataSource1: TDataSource;
Table1: TTable;
DBGrid1: TDBGrid;
Button1: TButton;
DBNavigator1: TDBNavigator;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var put:string;
begin
DBGrid1.DataSource:=DataSource1;
DataSource1.DataSet:=Table1;
DBNavigator1.DataSource:=DataSource1;
put:=ExtractFilePath(Application.exename);
Table1.Active := False;
Table1.DatabaseName :=(put);
Table1.TableName :='basa';
Table1.TableType := ttParadox;
if not Table1.Exists then
with Table1 do
begin
with FieldDefs do
begin
Clear;
Add('', ftINTEGER,0 , true);
Add('naimenovanie', ftstring, 25, FALSE);
Add('data', ftDate,0, False);
Add('', ftInteger, 0, False);
Add('kol-vo', ftInteger, 0, False);
end;
CreateTable;
end;
Table1.Active := true;
end;
end.



Скачать