我给你一个例子:
Query1.close;
Query1.Sql.clear;
query1.sql.add('insert into std Values ('''+edit1.text+''','''+
edit2.text+''','''+ edit3.text+''',
oho)');
{query1.close;
query1.sql.clear;
Query1.SQL.Add('select * from std');
query1.Open;
query1.insert;
query1.FieldByName ('std_no').AsString:='001';
tblobfield(query1.FieldByName('std_poto')).LoadFromFile('C:/5.jpg');
}
MySTM:=TmemoryStream.Create;
image1.Picture.LoadFromFile('C:/5.jpg');
myJpeg:=TJPEGImage.Create;
MyJpeg.LoadFromFile('C:/5.jpg');
Myjpeg.savetostream(Mystm);
MySTM.Seek(0,0);
Query1.Parameters[0].LoadFromStream(MySTM,ftBlob);
if assigned(MySTM) then
MySTM.Free;
Query1.ExecSQL;