procedure TForm1.Button1Click(Sender: TObject);
var
tmpStream:TMemoryStream;begin
  OpenPictureDialog1.Filter:='bitmap files(*.bmp)|*.bmp';
  if OpenPictureDialog1.Execute then
   begin
    Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName);
   end;   tmpStream := TMemoryStream.Create;   try   if Image1.Picture.bitmap <> nil then
Image1.Picture.Bitmap.SaveToStream(tmpStream);
    adoquery1.Close;
    adoquery1.SQL.Clear;
    adoQuery1.SQL.Add('insert into tp表(picture).values ('':picture'')');    // 进行插入操作     adoQuery1.SQL.Add(' Where (tp_ID=:ltpid)');
    adoQuery1.Parameters.ParamByName('picture').LoadFromStream(tmpStream,ftBlob); // 读取保存的内存图
    adoQuery1.Parameters.ParamByName('ltpid').Value:=12;    adoquery1.ExecSQL;   finally
    tmpStream.Free;
   end;end;在运行的时候没有问题,在找到图片,点击打开的时候就出现"adoquery1 :parameter 'picture'not fount"  请问这是什么问题? 在数据库中有这个字段的。

解决方案 »

  1.   

    select picture,日期,编号,名称
    from tp表这是单独的一个表,
    你是说” adoQuery1.SQL.Add('insert into tp表(picture).values ('':picture'')');    “
    这句有问题?
      

  2.   

    'insert into tp表(picture).values ('':picture'')'
    ------------------------------------------------
    应该是:'insert into tp表 (picture) values ('':picture'')'
      

  3.   

    应该是:'insert into tp表 (picture) values ('+:picture+')'
      

  4.   

    2004按照你的方法
    运行就出现错误
    我这样修改了
    insert into tp表(picture).values (''&picture&'')运行可以
    还是出现相同的错误。
      

  5.   

    (picture).values 这个中间的.是干什么用的呢? inset into 语句中有这样的写法?