Newbie question (Borland C++ / mySQL)

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
winsth
Posts: 3
Joined: Sat 06 May 2006 19:09
Contact:

Newbie question (Borland C++ / mySQL)

Post by winsth » Sat 06 May 2006 19:14

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

swierzbicki
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Post by swierzbicki » Sun 07 May 2006 05:49

"SELECT SUM(money) As MySum FROM bank_tbl"

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

winsth
Posts: 3
Joined: Sat 06 May 2006 19:09
Contact:

Thanx!

Post by winsth » Sun 07 May 2006 07:23

Thanx! Have a nice day! :D

Post Reply