数据库中图形文件(*.bmp,*.jpg等)怎样存储?(50分)

  • 主题发起人 jyjsjxsy
  • 开始时间
J

jyjsjxsy

Unregistered / Unconfirmed
GUEST, unregistred user!
[blue][/blue]数据库中,图形文件怎样存储呀?例如:在做人事管理时,头像,文件扫描件,
怎样存入数据库?
 
用blob字段,然后用流存储进去不就行了吗
 
(TableStaffsEx.FieldByName('Photo') as TBlobField).LoadFromFile('a.bmp');
 
察看以前的贴子,多的是
 
...
table.Append;
(tblobfield(table.FieldByName('Imagfield'))).LoadFromFile('e:/a.tmp');
...
 
In the example below, the Assign method is used to copy the bitmap from a TImage component into a BLOB field through its TBlobField field object:

if not (ClientDataSet1.State in [dsInsert, dsEdit]) then
ClientDataSet1.Insert;

ClientDataSet1Images.Assign(Image1.Picture);
ClientDataSet1.Post;
 
多人接受答案了。
 
顶部