adoquery1.close;
adoquery1.sql.add('insert into 表 (图片字段) values(:pic)');
adoquery1.Parameters.ParamByName('pic').LoadFromFile('图片路径',ftGraphic);
adoquery1.ExecSQL;

解决方案 »

  1.   

    lincanwen 你好,谢谢你的回答,但我用的是ADOTable控件,请问如何存取?存取的是TBitMap还是TPicture类型的,解决一定给分!
      

  2.   

    你放一个dbimage
    然后用
    with adotable1 do
    begin
    append;
    dbimage1.pictrue.loadfromfile('c:\a.bmp');
    post;
    end;
      

  3.   

    赞同My_first(海浪),我自己就用这种简单方法,但稳,明了。
      

  4.   

    with adotable1 do
    begin
    edit;
    dbimage1.pictrue.loadfromfile('c:\a.bmp');
    post;
    end;
    其实,存进去的还是路径
      

  5.   

    var
      st: TStringStream;
    begin
      st := tstringstream.create('');
      bitmap.savetostream(st);
      query1.sql.text := 'insert into table Image_field values :bmp';
      query1.parambyname('bmp').asblob := st.datastring;
      query1.execsql;
      st.free;
    end;
      

  6.   

    gmc007(江西的佬表) 请问你有什么方法吗?
      

  7.   

    var   
        Pic:  TPicture; 
    begin 
        Pic  :=  TPicture.Create; 
        try         Pic.LoadFromFile('c:\a.bmp'); 
            .....         Table1.FieldByName('Photo').Assign(Pic); 
             ..... 
         finally 
            FreeAndNil(Pic); 
        end;