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

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

Postby Rocojo » Tue 24 Jan 2006 13:07

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....
Rocojo
 
Posts: 18
Joined: Tue 24 Jan 2006 12:57
Location: Eindhoven, The Netherlands

Postby Rocojo » Tue 24 Jan 2006 15:32

ok i found by help of the topic obove..... thank you

MyQuery->FieldValues[FieldName]

after executing the query by MyQuery->Execute();
Rocojo
 
Posts: 18
Joined: Tue 24 Jan 2006 12:57
Location: Eindhoven, The Netherlands

Postby Ikar » Tue 24 Jan 2006 15:56

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.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby Rocojo » Tue 24 Jan 2006 22:04

hmm thank you. I will try
Rocojo
 
Posts: 18
Joined: Tue 24 Jan 2006 12:57
Location: Eindhoven, The Netherlands


Return to MySQL Data Access Components