Page 1 of 1

Wrong value returned in ZQuery 7.0.3 with FB 2.1

Posted: 16.07.2014, 23:34
by eelias
Hi there,

I have Delphi XE2 Update 4 with Zeos 7.0.3-stable running in a XP VM.

It was running fine with an old Firebird 1.0 (!!!). Then the customer migrated to Firebird 2.1

Then this problem is happening:

Code: Select all

ZQuery.SQL.Clear;
ZQuery.SQL.Add('Select * from CONFIG_SISTEMA');
ZQuery.Open;

//... many successful attributions.. >

// crashes in the line bellow
pubLIMITEFECHACAIXA := ZQuery.FieldByname('LIMITEFECHACAIXA').AsDateTime;



This particular field is a VARCHAR(5) and contains the value '7:00'

The windows locale is correct, and in the same computer just connecting on FB 1.0 it works fine on the same table and data.

I have experienced such thing before, that ZEOS somehow does not interpret/Set the correct field type and FB does not understand. Seems it is happening here.

Even If I use .ASString what comes back is a NULL value.

Is there a workaround to get the value from the database?

Thank you

Re: Wrong value returned in ZQuery 7.0.3 with FB 2.1

Posted: 31.07.2014, 18:10
by marsupilami
Hello eelias,

what exception message do you get? Does that also happen on Zeos 7.1? Usually I would expect you to do something like this:

Code: Select all

pubLIMITEFECHACAIXA := StrToTime(ZQuery.FieldByname('LIMITEFECHACAIXA').AsString);
becausse '7:00' doesn't have a date part?
Best regards,

Jan