No result set with ZQuery, but ok with ZReadOnlyQuery

Forum related to version 6.1.5 of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Sharmway
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 27.01.2006, 19:55
Contact:

No result set with ZQuery, but ok with ZReadOnlyQuery

Post by Sharmway »

Im looking for help with a strange problem i encountered lately.
AnsiString sql;
ZQuery1>Close();
ZQuery1->SQL->Clear();
sql = "SELECT max(productid) FROM products;";
ZQuery1->SQL->Add( sql );
ZQuery1->Open();

AnsiString productid = ZQuery1->Fields->FieldByNumber(1)->AsString;
ShowMessage(productid);

ZReadOnlyQuery1->Close();
ZReadOnlyQuery1->SQL->Clear();
sql = "SELECT max(productid) FROM products;";
ZReadOnlyQuery1->SQL->Add( sql );
ZReadOnlyQuery1->Open();

AnsiString productidapprove = ZReadOnlyQuery1->Fields->FieldByNumber(1)->AsString;
ShowMessage(productidapprove);


The first query returns NULL, the seconds is working as intended.
Im using Borland C++ builder 6, postgres 7.3.
Appriciating any comments
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

Check the property ShowRecordTypes. It should be set to "[ztModified,ztInserted,ztUnmodified]"
Sharmway
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 27.01.2006, 19:55
Contact:

Post by Sharmway »

Yes that helped.
Thanks a lot. Probably i missed some changes in Zeoslib.
Thanks again.
zippo
Silver Boarder
Silver Boarder
Posts: 322
Joined: 12.10.2005, 18:01
Location: Slovenia

Post by zippo »

It happens after the upgrade from an earlier version or switching from another MySQL comonents.. I crashed my head, so now I can be the wize guy.. :):):):)
Post Reply