如下过程可将文件存入Blob,哪管是BMP,还是JPG
procedure TForm1.Button1Click(Sender: TObject);
var MemStm : TMemoryStream;
BlobStm: TStream;
begin
MemStm := TMemoryStream.Create;
MemStm.LoadFromFile('ReadMe.txt');
Query1.Edit;
BlobStm:=Query1.CreateBlobStream(Query1.FieldByName('C2'), bmReadWrite);
try
MemStm.SaveToStream(BlobStm);
except
end;
BlobStm.Free;
MemStm.Free;
end;
我做了个将图片以JPEG存入数据库的控件,需要的话,给我联系!