Page 1 of 1

No result set with ZQuery, but ok with ZReadOnlyQuery

Posted: 27.01.2006, 20:05
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

Posted: 28.01.2006, 12:19
by zippo
Check the property ShowRecordTypes. It should be set to "[ztModified,ztInserted,ztUnmodified]"

Posted: 28.01.2006, 23:34
by Sharmway
Yes that helped.
Thanks a lot. Probably i missed some changes in Zeoslib.
Thanks again.

Posted: 30.01.2006, 13:10
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.. :):):):)