目的:先将ms sql2000的image字段的内容保存到图象文件中,然后将该文件拷贝到其他电脑,最后再读入ms sql2000的image字段中。请大家给段成熟的代码或方法!谢谢!!

解决方案 »

  1.   

    TBlodFiled(Filed).SaveToStream(FileStream);
      

  2.   

    我觉得存储Image图片的路径比较合适
    这样操作起来也方便
      

  3.   

    TBlodFiled是什么?一直没用过呢
      

  4.   


    qry.fieldByanme('aa').assign('file_path')
      

  5.   

    谢谢楼上,已实现!
    大家分享吧:    //保存到相片文件
         //exlpath是路径
        if DQuery.FieldByName('Isbmp').AsString='0' then
        begin
          ZPfilename:=exlpath+DQuery.FieldByName('ZPFileName').AsString;
          TBlobField(DQuery.FieldByName('ZP')).Savetofile(ZPfilename);
        end;
     
        //从相片文件读取
         //exlpath是路径
        if Query2.FieldByName('Isbmp').AsString='0' then
        begin
         ZPfilename:=exlpath+Query2.FieldByName('ZPFileName').AsString;
         if FileExists(ZPfilename) then
         begin
          Query2.Edit;
          TBlobField(Query2.FieldByName('ZP')).Loadfromfile(ZPfilename);
          Query2.Post;
         end;
        end;