下面是插入语句,
adoquery1.SQL.Text:='insert into tbltemp(image,name) VALUES (:photo,'''+edit1.text+''')'; // 进行插入操作
  adoQuery1.Parameters.ParamByName('photo').LoadFromStream(Stream,ftBlob); // 读取保存的内存图
改成修改语句adoquery1.SQL.Add('update tbltempset id='''+edit1.text+'''');.......adoquery1.SQL.Add(',image='':photo''');
adoquery1.SQL.Add(' where [NO]='''+intNum+'''');
adoQuery1.Parameters.ParamByName('photo').LoadFromStream(Stream,ftBlob); 
为什么总时出错:parameter 'ohoto' not found

解决方案 »

  1.   

    使用之前先创建参数
    ADOQuery1.Parameters.CreateParameter()
      

  2.   

    是在begin 之前加 ADOQuery3.Parameters.CreateParameter()  这条吗
      

  3.   

    你直接在界面上ADOQuery3 的inspecter 上的 Parameters  添加好 也行的;
      

  4.   

    前面正确的:photo没引号,后面出错的:photo被你用引号包住了。
      

  5.   

    出现 not enough actual parameters 错误procedure TForm2.BitBtn12Click(Sender: TObject);
    var
    intnum:string;
    Stream:TMemoryStream;
    begintry
    Stream := TMemoryStream.Create; // 创建内存流Image1.Picture.Graphic.SaveToStream(Stream); // 将图片保存到内存流中
    Stream.Position :=0;
    intNum:=dbgrideh3.Fields[0].AsString;
    adoquery3.Close;
    adoquery3.SQL.Clear;
    adoquery3.SQL.Add('update s_sales2 set name='''+combobox19.text+'''');
    adoquery3.SQL.Add(',make='''+combobox34.text+'''');
    adoquery3.SQL.Add(' where [NO]='''+intNum+'''');
    ADOQuery3.Parameters.CreateParameter()
    ADOQuery3.Parameters.ParamByName('photo').Assign(Image1.Picture.Bitmap);adoquery3.ExecSQL;
    Stream.Free; // 释放内存流
    finally
    adoquery3.SQL.Clear;
    adoquery3.sql.Add('select * from s_sales2');
    adoquery3.open;
    Panel3.Visible:=false;
    showmessage('保存成功!');
    end;
    end;
      

  6.   

    6楼正解!
    你没事加个引号干嘛?那样,photo就成了一个字符常量了。