I use Borland C++ Builder 6 together with the ZEOS library for communication with a MySQL database. Before I used the old ZEOS lib (6.1.5 stable) together with a MySQL4 database. Everything worked perfect, but I had to upgrade to MySQL 5.1 now, so that's why I upgraded to ZEOS library 6.6.6. If i test my application now, I come to the following:
- there is a connection with the database
- I can do an Insert() and a Post() and the records are perfectly added to the database
problem:
I perform a very simple query:
Code: Select all
SELECT myfield FROM mytable
this is the code as it worked with ZEOSlib 6.1.5
Code: Select all
QueryString = "SELECT myfield FROM mytable";
ZQuery->Active = false;
ZQuery->SQL->Clear();
ZQuery->SQL->Add(QueryString);
ZQuery->Active = true;
AnsiString A = ZQuery->FieldByName("myfield")->AsString;
// A contains the right value
My latest version for now (with ZEOSlib 6.6.6), which is not working:
Code: Select all
QueryString = "SELECT myfield FROM mytable";
ZQuery->Active = false;
ZQuery->SQL->Clear();
ZQuery->SQL->Add(QueryString);
// ZQuery->RequestLive = true;
// ZQuery->Active = true;
ZQuery->Open();
AnsiString A = ZQuery->FieldByName("veld")->AsString;
// A is NULL
maybe some other usefull info:
- ik tried to use both libmysql.dll and libmysql51.dll
- when I look at the content of ZQuery->SQL->Text then I see that the value is not only my QueryString, but a \r\n is added to it. I have no idea how to get rid of the \r\n on that point and i have no idea if it has anything to do with my problem.