with query1 do
begin
Close;
sql.clear;
sql.add('insert into traveller(tno,nam,pht)');
sql.add(' values
p_tno,
_nam,
_pht)');
parambyname('p_tno').asstring:=edtno.text;
parambyname('p_nam').asstring:=trim(edtname.text);
if image2.picture.bitmap.empty then
parambyname('p_pht').asstring:='n' //标志为pht空
else
begin
try
tempjpeg:=tjpegimage.create;
tempjpeg.assign(image2.picture.Bitmap);
tempJpeg.JPEGNeeded;
tempJpeg.CompressionQuality:=30;
tempJpeg.Compress;
tempStream:=TStringStream.Create('');
tempJpeg.SaveToStream(tempStream);
tempstream.position:=0;
parambyname('p_pht').asblob := tempstream.datastring;
finally
tempjpeg.free;
tempstream.free;
end;
end;
end;
我做的是把一个image的图片转化成jpeg格式存储在paradox和mssql的blob字段里,用了好多次,
没出过问题。试试看,怎么样。
另:barton:羞愧,tibsql是什么东东,麻烦说清楚一点。