使用TDBImage控件。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Db, DBTables, StdCtrls, DBCtrls;
type
TForm1 = class(TForm)
Table1: TTable;
DBImage1: TDBImage;
DataSource1: TDataSource;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
DataSource1.DataSet:=Table1;
DBImage1.DataSource:=DataSource1;
DBImage1.DataField:='BLOBFILE';
Table1.Close;
Table1.Database:='别名';
Table1.TableName:='aaa';
Table1.Open;
end;
end.