Page 1 of 1

Newbie question (Borland C++ / mySQL)

Posted: Sat 06 May 2006 19:14
by winsth
Hi all!

I have a question that probably all of you will be able to answer...
I created an application that connects to my server and queries for example "SELECT SUM(money) FROM bank_tbl". Right now the sum is presented in a DBGrid.

How can I display the result from the query in a textfield or a Label? In other words - How can I extract data from the result without using DBGrid?

Many thanx in advance!!

/ Magnus Winsth

Posted: Sun 07 May 2006 05:49
by swierzbicki
"SELECT SUM(money) As MySum FROM bank_tbl"

label1->caption = floattostr(MyQuery->fieldbyname('MySum')->AsFloat);

Thanx!

Posted: Sun 07 May 2006 07:23
by winsth
Thanx! Have a nice day! :D