table1.Append;  TBlobField(table1.FieldsByName('pic').Assign(img1.Picture.Graphic));
  table1.Post;

解决方案 »

  1.   

    按你的方法做了却提示:“Invalide typecast”?
      

  2.   

    Or
    Image1.savetostream(stram1);
    stream1.positon:=0;
    tblobfield(Table1.FieldsByName('pic')).loadfromstream(stream1)
    table.post;
    :>
      

  3.   

    //往sql server写入写出任意文件:估计对ACCESS也有效。试试看吧。
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      Grids, DBGrids, Db, DBTables, StdCtrls;type
      TForm1 = class(TForm)
        Label1: TLabel;
        DataSource1: TDataSource;
        Table1: TTable;
        DBGrid1: TDBGrid;
        Button2: TButton;
        Button3: TButton;
        OpenDialog1: TOpenDialog;
        Database1: TDatabase;
        Label2: TLabel;
        procedure Button2Click(Sender: TObject);
        procedure Button3Click(Sender: TObject);
      private
        scAppDir:string;
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button2Click(Sender: TObject);
    var
      fdBlob:TBlobField;
    begin
    //注意:Sql Server中存在Test数据库,Table1表,fdBin字段(image)类型。
      Table1.Close;
      scAppDir:=ExtractFilePath(ParamStr(0));
      fdBlob:=TBlobField.Create(Application);
      fdBlob.FieldName:='fdBin';
      fdBlob.DataSet:=Table1;
      Table1.Open;
      Table1.Edit;
      fdBlob.LoadFromFile(scAppDir+'tt.zip');
      Table1.Post;
      fdBlob.Free;
      Table1.Open;
    end;procedure TForm1.Button3Click(Sender: TObject);
    var
      fdBlob:TBlobField;
    begin
    //注意:Sql Server中存在Test数据库,Table1表,fdBin字段(image)类型。
      Table1.Close;
      scAppDir:=ExtractFilePath(ParamStr(0));
      fdBlob:=TBlobField.Create(Application);
      fdBlob.FieldName:='fdBin';
      fdBlob.DataSet:=Table1;
      Table1.Open;
      fdBlob.SaveToFile(scAppDir+'dd.zip');
      fdBlob.Free;
      Table1.Open;end;end. 
      

  4.   

    table.edit;
    image.picture.loadfilename(路径);
    table1.post
      

  5.   

    老鱼同志,按你的方法做了,但问题照旧,会不会是delphi6和delphi5间关于这方面存在区别?好像又不像。