Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"ADOQUERY3: Parameter 'p' not found" error (PLEASE HELP!!!!!)

Status
Not open for further replies.

JuanchoDev

Programmer
Apr 20, 2010
2
AR
I´m trying to modify a register on a data base(access) and always get this error...any help ´ll be really appreciated.




procedure TForm3.Modificar1Click(Sender: TObject);
var cons1, cons2, cons3:string;


begin
if edit2.Text = edit9.Text then
begin
adoquery2.Close;
adoquery2.SQL.Text:='select id from colaboradores where usuario=:p';
adoquery2.Parameters.ParamByName('p').Value:=edit1.Text;
adoquery2.Open;

adoquery3.Close;

//cons1:='select colaboradores.id, colaboradores.usuario, colaboradores.password, colaboradores.nombre, colaboradores.apellido, colaboradores.direccion, colaboradores.telefono, colaboradores.email, colaboradores.web, colaboradores.rol, colaboradores.fecha ';
//cons2:='from colaboradores, roles ';
//cons3:='where colaboradores.rol=roles.id and colaboradores.id=:p';
adoquery3.SQL.Add('select colaboradores.id, colaboradores.usuario, colaboradores.password, colaboradores.nombre, colaboradores.apellido, colaboradores.direccion, colaboradores.telefono, colaboradores.email, colaboradores.web, colaboradores.rol, colaboradores.fecha ');
adoquery3.SQL.Add('from colaboradores, roles ');
adoquery3.SQL.Add('where colaboradores.rol=roles.id and colaboradores.id=:p') ;
adoquery3.SQl.Text:=adoquery3.Parameters.ParseSQL(adoquery3.SQL.Text,true);
//adoquery3.SQL.Text:=cons1+cons2+cons3;
//adoquery3.Parameters.ParseSQL(adoquery3.SQL.Text,true);
adoquery3.Parameters.ParamByName('p').Value:=adoquery2.Fields[0].AsInteger;
adoquery3.Open;
adoquery3.Edit;
adoquery3.Fields[1].AsString:=edit1.Text;
adoquery3.Fields[2].AsString:=edit2.Text;
adoquery3.Fields[3].AsString:=edit3.Text;
adoquery3.Fields[4].AsString:=edit4.Text;
adoquery3.Fields[5].AsString:=edit5.Text;
adoquery3.Fields[6].AsString:=edit6.Text;
adoquery3.Fields[7].AsString:=edit7.Text;
adoquery3.Fields[8].AsString:=edit8.Text;

//averiguo el rol
adoquery4.Close;
adoquery4.SQL.Text:='select id from roles where rol=:p';
adoquery4.Parameters.ParamByName('p').Value:=combobox1.Text ;
adoquery4.Open;
adoquery3.Fields[9].AsInteger:=adoquery4.Fields[10].AsInteger;
adoquery3.Fields[10].AsString:=edit10.Text;
adoquery3.Post;
showmessage('Registro modificado exitosamente!');
adoquery3.Close;

end

else

showmessage('Las Contraseñas no fueron confirmadas correctamente, deben ser iguales');


end;
 
set the ParamCheck property to True to autoparse Parameters.

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top