我用的是PARADOX的数据库。表的一个字段类型是图片。  
插入图片时用  
table1.insertrecord(edit1.text,image1.picture)  
编译通过了,  运行时图片是a.bmp类型,  
出现了错误"LIST  INDEX  OUT  OF  BOUNDS",请求各位高手的指

解决方案 »

  1.   

    你直接向数据库插入图片?不是吧,这样肯定是出问题的。图片文件是需要用流文件的格式来读的,这是一个代码:var
      sFileName:string;
      
      function BlobConentToString(const FileName:String):String;
      begin
        with TFileStream.create(FileName,fmOpenRead)do
        try
          SetLength(Result,Size);
          Read(Pointer(Result)^,Size);
        finally
          Free;
        end;
      end;
    begin
      if (Opendialog1.execute) then
      begin
        sFileName:=OpenDialog1.FileName;
        adotable1.edit;
        adotable1.fieldbyname('blobs').asstring:= blobcontenttoString(sFileName);
        AdoTable1.post;
      end;
    end;