如果存的是AutoCad格式的文件,dbimage就无法打开了。

解决方案 »

  1.   

    AutoCad那就只能用能打开这东西的东西来了。其它控件无法解读共格式。
      

  2.   

    hi,man:
      i have received following message for this kind of question, he has used TFileStream to load any picture.这可以处理多种格式的图象文件
    procedure TFrmblobexample.Button1Click(Sender: TObject);
    begin
    if(opendialog1.execute)then
    begin
    sfilename:=opendialog1.filename;
    adoquery1.Append;
    adoquery1.FieldByName('name').asstring:=sfilename;
    adoquery1.fieldbyname('blobs').asstring:=blobcontenttostring(sfilename);
    adoquery1.post;
    end;
    end; function TFrmblobexample.blobcontenttostring(
    const filename: string): string;
    begin
    with tfilestream.create(filename,fmopenwrite)do
    try
    setlength(result,size);
    read(pointer(result)^,size);
    finally
    free;
    end;
    end;My question:
       when i save image to SQL SERVER image field,  My Delphi BDE always returns "BDEDatabaseerror for INVALID BLOB SIZE",i do not know whether it is the mistake of my Delphi 5.5 or the Mistake of SQL SERVER.
      

  3.   

    将它存入到一个临时文件里,用WinExec打开它