Wrong value returned in ZQuery 7.0.3 with FB 2.1

Forum related to Firebird

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
eelias
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 11.07.2013, 00:36

Wrong value returned in ZQuery 7.0.3 with FB 2.1

Post 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
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1935
Joined: 17.01.2011, 14:17

Re: Wrong value returned in ZQuery 7.0.3 with FB 2.1

Post 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
Post Reply