Предполагается, что это БД с картинками, но картинки не появляются...
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, DB, DBTables, DBCtrls, Mask,jpeg;
type
TForm1 = class(TForm)
DataSource1: TDataSource;
Table1: TTable;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Image1: TImage;
DBNavigator1: TDBNavigator;
DBEdit3: TDBEdit;
DBEdit1: TDBEdit;
DBEdit2: TDBEdit;
DBEdit4: TDBEdit;
DBEdit5: TDBEdit;
DBEdit6: TDBEdit;
DBEdit7: TDBEdit;
DBEdit8: TDBEdit;
DBEdit9: TDBEdit;
DBEdit10: TDBEdit;
DBEdit11: TDBEdit;
procedure Tabel1AfterScroll(DataSet:TDataSet);
procedure DBEdit3KeyPress(sender:TObject;Var Key:char);
procedure DBNavigator1Click(Sender:Tobject;Button:TNavigateBtn);
procedure Tabel1BeforeOpen(DataSet:TDataSet);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
BmpPath:string;
implementation
{$R *.dfm}
procedure TForm1.Tabel1BeforeOpen(DataSet:TDataSet);
begin
BMPPath:=ExtractFilePath(ParamStr(0))+'data\';
end;
procedure ShowFoto(foto:string);
begin
try
Form1.Image1.Visible:=True;
Form1.Image1.Picture.LoadFromFile(BmpPath+foto);
Form1.Image1.Visible:=True;
except
on EFOpenError do
begin
MessageDlg('картинка'+foto+'не существует.',mtinformation,[mbOK],0);
end;
end;
end;
procedure TForm1.Tabel1AfterScroll(DataSet:TDataSet);
begin
If form1.DBEdit3.Visible then
begin
form1.DBEdit3.Visible:=False;
form1.Label4.Visible:=False;
end;
If Form1.DBEdit3.Text<>''
then ShowFoto(form1.DBEdit3.Text)
else form1.Image1.Visible:=False;
end;
procedure TForm1.DBEdit3KeyPress(sender:TObject; Var Key:Char);
begin
If (Key=#13) then
If Form1.DBEdit3.Text<>''
then ShowFoto(Form1.DBEdit3.Text)
else form1.Image1.Visible:=False;
end;
procedure TForm1.DBNavigator1Click(Sender:TObject;Button:TNavigateBtn);
begin
case Button of
nbInsert:begin
Image1.Visible:=False;
dbEdit3.Visible:=True;
Label4.Visible:=True;
end;end;end;
end.
end.