Re: Problem with TDateTime and ADO



Oleg wrote:

Hi!

I have some problem when we try to set field of timestamp type in Interbase database using TAdoQuery component. As result I can see updated field in database, but a value content only date without time-part. For connection I use Easysoft IB6 ODBC driver. It's a part of our code:



procedure TForm1.Button1Click(Sender: TObject);

begin

ADOQuery1.SQL.Text :=

'update cheques set chargeddate = :chargeddate where chequeno = :chequeno';

ADOQuery1.Parameters.ParamByName('chequeno').Value := 12345;

ADOQuery1.Parameters.ParamByName('chargeddate').Value := now;

ADOQuery1.ExecSQL;

end;



Any ideas?


the problem is when delphi / ODBC extract the parameters info they set it to adDate
TO solve this problem you have to set the oleParameter to adDBTimeStamp like this

ADOQuery1.Parameters.ParamByName('chargeddate').ParameterObject.Type_ := adDBTimeStamp;

.


Quantcast