Page 1 of 1
Problem with .Value parameters and Date fields
Posted: Thu 27 Jun 2019 09:30
by badmood
Dear all,
after updating to version 7.5, recompiling my program with
Code: Select all
AQuery.ParamByName('from_date').Value := ADate; // working before 7.5
gives me an error about a incompatible date => integer type
changing to:
Code: Select all
AQuery.ParamByName('from_date').AsDate := ADate;
works as expected.
Regards.
Sergio
Re: Problem with .Value parameters and Date fields
Posted: Tue 02 Jul 2019 05:08
by ViktorV
Please specify the DBMS (and its version) you are working with.
Re: Problem with .Value parameters and Date fields
Posted: Tue 02 Jul 2019 14:02
by badmood
PostgreSQL version 11.4
Regards.
Sergio
Re: Problem with .Value parameters and Date fields
Posted: Wed 03 Jul 2019 08:00
by MaximG
We've tested the operation of UniDAC according to your description and haven't identified any issues. Please send us a full sample demonstrating the issue so that we could further research it. Additionally, we need the DLL script that creates tables and a sample table with data. You may use the e-support form on our website to upload the sample
https://www.devart.com/company/contactform.html
Re: Problem with .Value parameters and Date fields
Posted: Fri 05 Jul 2019 10:58
by badmood
After some call from my customers for errors like "1.5 is not a valid integer" date parameters, I reverted to UniDAC previous version and recompile my programs. Magically the problems vanished.
I can't believe it's working for you.
Fastest sample:
Drop a TUniConnection and connect to any DB with a table containing a DATE field.
Drop a PostgreSQL data provider on the form.
Drop a DateTimePicker on a form.
Drop a TButton on a form.
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var
qryDummy: TUniQuery;
begin
qryDummy := TUniQuery.Create(self);
with qryDummy do
begin
Connection := UniConnection1;
SQL.Text := 'SELECT * FROM fatture_t WHERE dt_documento = :dt ';
ParamByName('dt').Value := DateTimePicker1.Date;
Open;
ShowMessage('Ok');
Close;
end;
FreeAndNil(qryDummy);
end;
compiled with version 7.5: run and click on the button: ERROR
compiled with version 7.4: run and click on the button: OK
I'm using Delphi 10.3 (not 10.3.1) if it can be of help.
Re: Problem with .Value parameters and Date fields
Posted: Fri 05 Jul 2019 15:23
by MaximG
Thank you for the information. We have reproduced the issue and will investigate its origin. We will inform you about the results shortly.
Re: Problem with .Value parameters and Date fields
Posted: Tue 09 Jul 2019 16:39
by MaximG
We're still investigating the described issue. As a temporary solution, you can use protocol version 3.0 to work with PostgreSQL data access provider:
Code: Select all
UniConnection.SpecificOptions.Values['ProtocolVersion'] := 'pv30';
Re: Problem with .Value parameters and Date fields
Posted: Wed 24 Jul 2019 15:14
by badmood
Dear support,
is it resolved in version 8?
Because my SpecificOptions already have pv30 as protocol version.
Regards.
Sergio
Re: Problem with .Value parameters and Date fields
Posted: Sun 01 Dec 2019 17:53
by badmood
Dear support,
it's been a long time (more than 4 months). Can you tell me if the problem is still there? I have a PostgreSQL server upgrade to do, but I can't use version 12 because I'm still with old version of your components.
I have renewed my subscription specifically for using version 12, can you answer the question please?
Regards.
Sergio
Re: Problem with .Value parameters and Date fields
Posted: Tue 10 Dec 2019 09:38
by MaximG
We've sent you the download link for the nightly build with all necessary changes in an email.