...but, the UPDATE problem exists also with a String-type column, that is not
only with bit-type columns.


  ----- Original Message ----- 
  From: mauro russo 
  To: delphi-en@yahoogroups.com 
  Sent: Tuesday, October 28, 2008 5:05 PM
  Subject: Re: [delphi-en] updating through ADOquery


  More, when the INSERT statement is executed, the bit-type columns do not 
  follow
  the value I gave to the parameters (I just realized it now).

  ----- Original Message ----- 
  From: "mauro russo" <[EMAIL PROTECTED]>
  To: <delphi-en@yahoogroups.com>
  Sent: Tuesday, October 28, 2008 5:04 PM
  Subject: Re: [delphi-en] updating through ADOquery

  The basic weird thing happend was that after I set the SQL statement
  in the SQL property in the object inspector, I found out the Parameters
  were not been created automatiaclly and I had to add one by one the 
  parameters.

  PS: the database is a "SQL Server 2005 Express" type.

  PS2: also the DELETE correctly works.

  ----- Original Message -----
  From: Marselle
  To: delphi-en@yahoogroups.com
  Sent: Tuesday, October 28, 2008 3:23 PM
  Subject: RE: [delphi-en] updating through ADOquery

  I would check with the simplest thing first.. make sure you have full 
  grant rights to the database..
  you would surprised how something this simple will have you chasing your 
  tail.

  Would it not be better to use FieldByName.AsString or cast it to the 
  proper type opposed to using .Value.. what if the value is null then you 
  could get an error.
  If all is setup correctly.. I would check with the simplest thing first.. 
  make sure you have full grant rights to the database..
  you would surprised how something this simple will have you chasing your 
  tail.

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

  > From: Wilson, Stephen <[EMAIL PROTECTED]>
  > Subject: RE: [delphi-en] updating through ADOquery
  > To: delphi-en@yahoogroups.com
  > Date: Tuesday, October 28, 2008, 8:53 AM
  > If your WHERE clause is not returning false (you say you
  > have checked the params here) then you might try showing any
  > error message in your except block, so:
  >
  > on E: Exception do
  > begin
  > RollbackADOTransaction(); //that is "if
  > ADOconn.InTransaction then ADOconn.RollbackTrans();
  > showmessage(E.message);
  > Result := false;
  > end;
  > end;
  >
  > -----Original Message-----
  > From: delphi-en@yahoogroups.com
  > [mailto:[EMAIL PROTECTED]
  > Behalf Of mauro russo
  > Sent: 28 October 2008 13:10
  > To: delphi-en@yahoogroups.com
  > Subject: Re: [delphi-en] updating through ADOquery
  >
  >
  > 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.
  >
  >
  >
  >
  > 
  ***************************************************************************
  > This e-mail and any files transmitted with it are
  > confidential. If you are not the intended recipient, any
  > reading, printing, storage, disclosure, copying or any other
  > action taken in respect of this e-mail is prohibited and may
  > be unlawful. If you are not the intended recipient, please
  > notify the sender immediately by using the reply function
  > and then permanently delete what you have received.
  > Content of emails received by this Trust will be subject to
  > disclosure under the Freedom of Information Act 2000,
  > subject to the specified exemptions, including the Data
  > Protection Act 1998 and Caldicott Guardian principles.
  > This footnote also confirms that, unless otherwise stated,
  > this email message has been swept by Sophos Anti-virus for
  > the presence of computer viruses.
  > 
  ***************************************************************************
  >
  >
  > ------------------------------------
  >
  > -----------------------------------------------------
  > 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]

  ------------------------------------

  -----------------------------------------------------
  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]



   
  ----------

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


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

Reply via email to