D duancy Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-10 #1 如题: 请问用query1.sql.add('insert into ......') 将图片存入数据库的BLOB字段。
S SoftBoy Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-11 #3 用数据流,这样的帖子很多了,你查查. http://www.delphibbs.com/delphibbs/dispq.asp?lid=804670
P pander Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-11 #4 Stream:=Tmemorystream.Create; Stream.LoadFromFile('xxx.bmp'); DM.CDS1.Close; DM.CDS1.CommandText:='insert into data (code,type,data) valuesCODE,:TYPE,ATA)'; DM.CDS1.Params[0].Value:='0005'; DM.CDS1.Params[1].Value:=3; stream.Seek(0,soFromBeginning); DM.CDS1.Params[2].LoadFromStream(STREAM,ftBlob); DM.CDS1.Execute; Stream.Free;
Stream:=Tmemorystream.Create; Stream.LoadFromFile('xxx.bmp'); DM.CDS1.Close; DM.CDS1.CommandText:='insert into data (code,type,data) valuesCODE,:TYPE,ATA)'; DM.CDS1.Params[0].Value:='0005'; DM.CDS1.Params[1].Value:=3; stream.Seek(0,soFromBeginning); DM.CDS1.Params[2].LoadFromStream(STREAM,ftBlob); DM.CDS1.Execute; Stream.Free;