The code looks like:

      AdoQuery.Connection := ADOconn; //AdoQuery is TADOWuery type, whereas 
ADOconn is TADOConnection type.
      ...
      AdoQuery.Parameters.ParamByName('Send_On_The_Fly').Value := 
MyCheckBox.Value;
      ... //here I can see by the watches that the value of the parameter 
Send_On_The_Fly is True.
          //(the type is ftBoolean because in the SQL database this column has 
'bit' type.

      StartADOTransaction(); //that is "if not ADOconn.InTransaction then 
ADOconn.BeginTrans();"
      try
        AdoQuery.ExecSQL();

        CommittADOTransaction(); //that is "if ADOconn.InTransaction then 
ADOconn.CommitTrans();"
        Result := true;
      except
        RollbackADOTransaction(); //that is "if ADOconn.InTransaction then 
ADOconn.RollbackTrans();"
        Result := false;
      end;


The AdoQuery.SQL.Text is:

UPDATE UB_INPUT_OPTIONS SET
Send_On_The_Fly = :Send_On_The_Fly,
Send_With_Rtc = :Send_With_Rtc,
[Save] = :[Save],
Send_Saved = :Send_Saved,
Save_With_Rtc = :Save_With_Rtc
WHERE Board_Id = :Board_Id AND
Classe = :Classe AND Indice = :Indice

The ADO connection works because the Insert and the Select work.
The ADOquery objects are design time objects, but the association with the 
ADOconn is at run time.
In fact ADOconn is a design time component of the main form, whereas this code 
runs in a form opened with SowModal.
Soon after the CommittADOTransaction, I open the DB with Microsoft SWL Express, 
but no change happends.
I checked for the parmaeters "board_id", "classe" and "indice" and they are 
correct.


Do you need other informations?
Do you know about some particular problem other people had in the past?
Thanks for support.



  ----- Original Message ----- 
  From: Marselle 
  To: [email protected] 
  Sent: Tuesday, October 28, 2008 1:27 PM
  Subject: Re: [delphi-en] updating through ADOquery


  Yes. But it would help to see what your SQL statement looks like.
  are you using dynamic Sql or is this a query being executed via stored 
procedure.
  Also check where you are executing the query.. are you using 
  queryobject.open
  or queryobject.executeSQL
  by queryobject this would be the name of your Ado Query Component.

  --- On Tue, 10/28/08, mauro russo <[EMAIL PROTECTED]> wrote:

  > From: mauro russo <[EMAIL PROTECTED]>
  > Subject: [delphi-en] updating through ADOquery
  > To: "delphi-en" <[email protected]>
  > Date: Tuesday, October 28, 2008, 7:18 AM
  > Dear all,
  > 
  > does anyone know about problems with update sql
  > instructions?
  > 
  > I have no errors back, I do Committ Transaction,
  > but it does not work.
  > 
  > Any help?
  > 
  > ----------
  > 
  > Questa email è stata verificata dal sistema centralizzato
  > antivirus della UniPlan Software
  > 
  > 
  > [Non-text portions of this message have been removed]
  > 
  > 
  > ------------------------------------
  > 
  > -----------------------------------------------------
  > Home page: http://groups.yahoo.com/group/delphi-en/
  > To unsubscribe: [EMAIL PROTECTED]
  > Groups Links
  > 
  > 
  > 



   
  ----------

Questa email è stata verificata dal sistema centralizzato antivirus della 
UniPlan Software


[Non-text portions of this message have been removed]

Reply via email to