sql Server中能否存储jpg图像文件?

解决方案 »

  1.   

    可以存  要用文件流的方式保存和读取(field as tblobfield).loadfromstream(...);
    (field as tblobfield).savetostream(...);or(field as tblobfield).loadfromfile(...);
    (field as tblobfield).savetofile(...);
      

  2.   

    可是编译的时候老是说
    [Error] Unit1.pas(352): Undeclared identifier: 'tBlobfield'
      

  3.   

    procedure Tfilemain.BitBtn6Click(Sender: TObject);
    var
      tempjpg:tjpegimage;
      pic:TMemoryStream;
    begin  tempjpg:=tjpegimage.Create;
      tempjpg.LoadFromFile(imagepath);
      pic:=TMemoryStream.Create;
      tempjpg.SaveToStream(pic);
      pic.Position:=0;
      if adotable1.Active=false then adotable1.Open;
      adotable1.append;
      adotable1.edit;
      TBlobField(adotable1.FieldByName('zwpic')).LoadFromStream(pic);
      adotable1.FieldByName('dah').Value:=dnum;
      adotable1.post;
      pic.Free;
      tempjpg.free;
      
    end;
      

  4.   

    我用的bde,怎么编译通过,就是写不进数据库,没有反应
      

  5.   

    楼主太小气,20点求这么严重的问题?
    加点后发消息给你的例子如何?mail
      

  6.   

    好哇,没有问题
    [email protected]
      

  7.   

    要使用TBlobField方法,必须先在USES中加入 “DB”