我的这段代码执行时出错:
var ww:TMemoryStream;
begin
    with ADOCommand1 do
    begin
       ww:=TMemoryStream.Create;
       Image1.Picture.Graphic.SaveToStream(ww);
       commandtext:='insert into table1 values(qq=:pp)';
       CommandType:=cmdText;
       Parameters.ParamByName('pp').LoadFromStream(ww,Parameters.ParamByName('pp').DataType);
       Execute;
    end;
end;错误提示:
---------------------------
Debugger Exception Notification
---------------------------
Project Project1.exe raised exception class EOleException with message '[Microsoft][ODBC SQL Server Driver]String data, right truncation'. Process stopped. Use Step or Run to continue.
---------------------------
OK   Help   
---------------------------

解决方案 »

  1.   

    qq是image型,我设置关键字之后还是不行。
      

  2.   

    你的提示是参数(字符型)超长截断
    我用的Query\Table将其中的image型字段与DbImage控件相连
    用DbImage控件的
    Picture.LoadFromFile(FileName);//读取文件
    用DbImage控件的
    Picture.SaveToClipboardFormat(AFormat,AData,APalette);
    Picture.LoadFromClipboardFormat(AFormat,AData,APalette);
    转换为二进制文件并写入内存
    用post提交
    以上可是我一下午才琢磨出来的存储图片源代码
      

  3.   

    我已经知道哪里错了,谢谢:jsyhello(不认输) ,
    更改如下:
       ww.Position:=0;
       Parameters.ParamByName('pp').LoadFromStream(ww,ftGraphic);