No result set with ZQuery, but ok with ZReadOnlyQuery
Posted: 27.01.2006, 20:05
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
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