Cita:
Empezado por giantonti1801
Pueden indicarme como hacer ahora para agregar mas informacion? es decir tengo que dentro del mismo update cambiar otros campos que estan igual en otro label
|
Me tomé la libertad de usar el mismo código del colega
giantonti1801, he incorporé otros atributos...
En mi opinión y por claridad, los parametros deberian tener el mismo nombre de los campos a actualizar. Por supuesto eso queda a criterio y gusto del colega...
Código Delphi
[-]
Close;
ADOQueryUpdate.SQL.Clear;
ADOQueryUpdate.SQL.Add( 'UPDATE Tiket'
ADOQueryUpdate.SQL.Add( 'SET ');
ADOQueryUpdate.SQL.Add( 'Estatus =:Estatus,');
ADOQueryUpdate.SQL.Add( 'Nombre =:Nombre,');
ADOQueryUpdate.SQL.Add( 'Apellido=:Apellido,');
ADOQueryUpdate.SQL.Add( 'Edad =:Edad');
ADOQueryUpdate.SQL.Add(' WHERE Item =:Item');
ADOQueryUpdate.Parameters.ParamByName('Estatus').Value :='OLD';
ADOQueryUpdate.Parameters.ParamByName('Nombre').Value :='Merluso';
ADOQueryUpdate.Parameters.ParamByName('Apellido').Value:='Boric';
ADOQueryUpdate.Parameters.ParamByName('Edad').Value :=19;
ADOQueryUpdate.Parameters.ParamByName('Item').Value := StrToInt(Label3.Caption);
ADOQueryUpdate.ExecSQL;
end;
Saludos cordiales