Page 1 of 1

How to get the result from a SELECT * FROM query in TMyQuery

Posted: Tue 24 Jan 2006 13:07
by Rocojo
Hello,

I am building a DLL (in Borland C++ Builder 6) witch is going to act as a layer between my software and a MySQL server.

I have two components: MyConnection and MyQuery.

this is what i am doing ( in short version):
MyQuery->SQL->Text = "SELECT * FROM "+ cmbTables->Text;
MyQuery->Execute();

the query is running and working because the MyQuery->RecordCount represents the exact number of rows.... but where can i get the returned values....

Posted: Tue 24 Jan 2006 15:32
by Rocojo
ok i found by help of the topic obove..... thank you

MyQuery->FieldValues[FieldName]

after executing the query by MyQuery->Execute();

Posted: Tue 24 Jan 2006 15:56
by Ikar
To get returned values you can use Fields property. For example:

Label1->Caption = MyQuery1->Fields->Fields[2]->AsString;

For more information see description of TDataSet.Fields in C++Builder Help.

Posted: Tue 24 Jan 2006 22:04
by Rocojo
hmm thank you. I will try