Cita:
Empezado por giantonti1801
Código Delphi [-]
ADOQuery1Item: TAutoIncField;
Es autonumerico pero lo que debo hacer es solo leerlo pero entonces el problema puede ser que venga de aqui ya que es este punto yo le estoy pasando el valor ITEM para luego leerlo
Código Delphi [-]Label3.Caption := ADOQuery1.fieldbyname('MINIMO').asstring;
[/delphi]
ADOQueryUpdate.SQL.Add( 'WHERE Item =:Item,');
ADOQueryUpdate.Parameters.ParamByName('Item').Value := StrToInt(Label3.Caption);
[/delphi]
|
Ya vi donde esta el problema pero si voy a necesitar ayuda
Código Delphi
[-]procedure TFormCaja.SpeedButton1Click(Sender: TObject);
begin
With ADOQuery1 do
begin
Close;
Open;
ADOQuery1.First;
begin
Label1.Caption := 'A00' + ADOQuery1.fieldbyname('MINIMO').asstring;
Label3.Caption := ADOQuery1.fieldbyname('MINIMO').asstring;
Image3.Visible := true;
begin
With ADOQueryUpdate do
Close;
Open;
ADOQueryUpdate.SQL.Add( 'UPDATE Tiket');
ADOQueryUpdate.SQL.Add( 'SET');
ADOQueryUpdate.SQL.Add( 'Estatus =:Estatus,');
ADOQueryUpdate.SQL.Add( 'Usuario =:Usuario,');
ADOQueryUpdate.SQL.Add( 'WHERE Item =:Item,');
ADOQueryUpdate.Parameters.ParamByName('Item').Value := StrToInt(Label3.Caption);
ADOQueryUpdate.Parameters.ParamByName('Estatus').Value :='OLD';
ADOQueryUpdate.Parameters.ParamByName('Usuario').Value := Label4.caption;
ADOQueryUpdate.ExecSQL;
end;
end;
end;
Resulta que me esta dando error porque como es el primer procedimiento aun el Label3.caption esta vacio por ellos me da este error debo colocar un IF pero no se donde poderlo colocar para que me funciones, es decir si el laber3.caption esta vacio que solamente corra la primera instrucion
Código Delphi
[-]procedure TFormCaja.SpeedButton1Click(Sender: TObject);
begin
With ADOQuery1 do
begin
Close;
Open;
ADOQuery1.First;
begin
Label1.Caption := 'A00' + ADOQuery1.fieldbyname('MINIMO').asstring;
Label3.Caption := ADOQuery1.fieldbyname('MINIMO').asstring;
Image3.Visible := true;
begin
de lo contrario que la recorra toda:
Código Delphi
[-]procedure TFormCaja.SpeedButton1Click(Sender: TObject);
begin
With ADOQuery1 do
begin
Close;
Open;
ADOQuery1.First;
begin
Label1.Caption := 'A00' + ADOQuery1.fieldbyname('MINIMO').asstring;
Label3.Caption := ADOQuery1.fieldbyname('MINIMO').asstring;
Image3.Visible := true;
begin
With ADOQueryUpdate do
Close;
Open;
ADOQueryUpdate.SQL.Add( 'UPDATE Tiket');
ADOQueryUpdate.SQL.Add( 'SET');
ADOQueryUpdate.SQL.Add( 'Estatus =:Estatus,');
ADOQueryUpdate.SQL.Add( 'Usuario =:Usuario,');
ADOQueryUpdate.SQL.Add( 'WHERE Item =:Item,');
ADOQueryUpdate.Parameters.ParamByName('Item').Value := StrToInt(Label3.Caption);
ADOQueryUpdate.Parameters.ParamByName('Estatus').Value :='OLD';
ADOQueryUpdate.Parameters.ParamByName('Usuario').Value := Label4.caption;
ADOQueryUpdate.ExecSQL;
end;