procedure TForm1.Btn_LoadImageClick(Sender: TObject); begin Table1.Edit; if OpenPictureDialog1.Execute then TBlobField(Table1.FieldByName('Image')).LoadFromFile((OpenPictureDialog1.FileName)) else ShowMessage('error'); end; 保证可以用啊,不过如果你的图片大于32K的话要设置一下bde的blob size 为64K.
我用的是BLOB类型的字段,不是LONG RAW 类型的!
还有其它方法吗?
begin
Table1.Edit;
if OpenPictureDialog1.Execute then
TBlobField(Table1.FieldByName('Image')).LoadFromFile((OpenPictureDialog1.FileName))
else
ShowMessage('error');
end;
保证可以用啊,不过如果你的图片大于32K的话要设置一下bde的blob size 为64K.
代码如下:
procedure TForm2.Btn_postClick(Sender: TObject);
begin
Query1.Append;
Query1AAAA.LoadFromFile('d:\back.bmp');
//query1AAA为一Blob 字段
Query1.Post;
end;
报告:‘LOB定位器无法扩展事务处理。’
这是为什么?