Скачиваний:
0
Добавлен:
07.03.2018
Размер:
2.03 Кб
Скачать
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.ExtCtrls, Vcl.DBCtrls,
Vcl.Grids, Vcl.DBGrids, Data.SqlExpr, Data.Win.ADODB, Vcl.StdCtrls, Vcl.Mask,
Vcl.ExtDlgs;

type
TForm1 = class(TForm)
DBG: TDBGrid;
DBENameC: TDBEdit;
Label1: TLabel;
DBEFind: TDBEdit;
Label2: TLabel;
DBMemo: TDBMemo;
DBIPIcture: TDBImage;
Label3: TLabel;
Label4: TLabel;
ADOQBase: TADOQuery;
DataSource1: TDataSource;
ODMemo: TOpenDialog;
OPDPicture: TOpenPictureDialog;
DBN: TDBNavigator;
procedure DBIPIctureClick(Sender: TObject);
procedure DBMemoChange(Sender: TObject);
procedure DBNClick(Sender: TObject; Button: TNavigateBtn);
procedure DBEFindChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}


procedure TForm1.DBEFindChange(Sender: TObject);
begin
with adoqbase do
begin
with sql do
begin
clear;
Add('SELECT * FROM CVETY WHERE namec like ' + QuotedStr('%'+ DBEFind.Text +'%'));
end;
active:=true;
end;
end;

procedure TForm1.DBIPIctureClick(Sender: TObject);
begin
if opdpicture.Execute then
dbipicture.picture.LoadFromFile(opdpicture.FileName);
end;

procedure TForm1.DBMemoChange(Sender: TObject);
begin
if odmemo.Execute then
dbmemo.Lines.LoadFromFile(ODMEMO.FileName);
end;

procedure TForm1.DBNClick(Sender: TObject; Button: TNavigateBtn);
begin
if BUTTON = NBiNSERT then dbenamec.SetFocus;

end;

procedure TForm1.FormCreate(Sender: TObject);
var
s, sdb:string;
begin
s:=extractfilepath(application.exename);
sdb:='provider=microsoft.jet.4.0;datasource='+s+'database.mdb;persist info=false';
with adoqbase do
begin
active:=false;
connectionstring:=sdb;
active:=true;

end;
end;

end.
Соседние файлы в папке лаба 3
  • #
    07.03.20181.37 Кб0Project1.dproj.local
  • #
    07.03.2018153 б0Project1.identcache
  • #
    07.03.201859.41 Кб0Project1.res
  • #
    07.03.2018170 б0Project1.stat
  • #
    07.03.20183.25 Кб0Unit1.dfm
  • #
    07.03.20182.03 Кб0Unit1.pas