假设我们使用如下:
//将文件转换为流形式
function BlobContentToString(const FileName:String):String;
begin
  with TFileStream.Create(FileName,fmOpenRead) do
  try
    SetLength(Result,Size);
    Read(Pointer(Result)^,Size);
  finally
    Free;
  end;
end;
将某一文件转换为流,保存到某一字段中,
现在如何使用TMemoryStream读出来并再声成文件/????????

解决方案 »

  1.   

    假设我们使用如下:
    //将文件转换为流形式
    function BlobContentToString(const FileName:String):String;
    begin
      with TFileStream.Create(FileName,fmOpenRead) do
      try
        SetLength(Result,Size);
        Read(Pointer(Result)^,Size);
      finally
        Free;
      end;
    end;
    将某一文件转换为流,保存到某一字段中,
    现在如何使用TMemoryStream读出来并再声成文件/????????
      

  2.   

    tblobfield(adoquery.fieldbyname('streamfield')).savetostream(stream)
    tblobfield(adoquery.fieldbyname('streamfield')).savetofile(file)