RT

解决方案 »

  1.   

    保存:
    if not(adoq_wjmxb.State in [dsinactive]) then
      begin
        if opendialog1.Execute then begin
          docname:=opendialog1.FileName;
          olecontainer1.CreateObjectFromFile(docname,true);
          olecontainer1.DoVerb(ovPrimary);      st := tstringstream.create('');
          olecontainer1.savetostream(st);
          with adoq_wjmxb do begin
            append;
            TBlobFIELD(Fieldbyname('wjnr')).LoadFromStream(st);
            post;
          end;
          st.free;
        end;
      end;
    显示:
    Stream := adoq_wjmxb.CreateBLOBSTREAM(adoq_wjmxb.fieldbyname('wjnr'),bmRead);
        if Stream.Size = 0 then begin
          Stream.Free;
          Exit;
        end;
     
        OleContainer1.CreateObject('word.document',true)    olecontainer1.loadfromstream(stream);
        stream.free;