阻
阻击手
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure Tfrm_savemb.b_saveClick(Sender: TObject);<br>var<br> stream:TADOBlobStream;<br> stream1:TFileStream;<br> filename:string;<br>begin<br> if copy(pub_mbdldm ,1,2)='12' then<br> begin<br> filename:=GetCurrentDir+'/'+'emrtemp.emk';<br> frm_mbbj.EMRPad301.FileSaveAs(FileName,2,0);<br> end<br> else<br> begin<br> filename:=GetCurrentDir+'/'+'emrtemp.emr';<br> frm_mbbj.EMRPad301.FileSaveAs(FileName,1,0);<br> end;<br> qry_mbmx.Close;<br> qry_mbmx.Parameters.ParamByName('mbid').Value:=pub_mbid;<br> qry_mbmx.Open;<br> if editmode='add' then qry_mbmx.Append;<br> if editmode='edit' then qry_mbmx.edit;<br> qry_mbmx['dm']:=pub_mbdldm;<br> qry_mbmx['mbmc']:=pub_mbmc;<br> qry_mbmx['mbsx']:=pub_mbsx;<br> qry_mbmx['zyksgs']:=pub_mbks;<br> qry_mbmx['mbczy']:=pub_czyxm;<br> if copy(pub_mbdldm ,1,2)='12' then<br> qry_mbmx['wjmc']:=pub_mbmc+'.emk'<br> else<br> qry_mbmx['wjmc']:=pub_mbmc+'.emt';<br> try<br> stream1:=TFileStream.Create(FileName,fmOpenRead);<br> stream1.Position:= 0;<br> stream:=TADOBlobStream.Create(qry_mbmx.FieldByName('mbwj')as TBlobField,bmRead);<br> stream.Position:=0;<br> stream.CopyFrom(stream1, stream1.Size);<br> qry_mbmx.Post;<br> Finally<br> stream.Free;<br> stream1.Free;<br> end;<br> close;<br>end;