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.
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.