Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Placing Query result into a variable

Status
Not open for further replies.

roberm1

Programmer
Mar 4, 2003
6
GB
Im a total C++ Builder n00b, I just want to place the results of a db query into a variable !
How do I do this ?

e.g.

String a, loc, type;
loc = "Alice";
type = "Select id from location where ward = '";
type += loc;
type += "'";
//Edit1->Text = type;

Query1->Close();
Query1->SQL->Clear();
Query1->SQL->Add(type);
Query1->ExecSQL();

So I have my query, how do I get the result into a variable ?

Thanks in advance, Mark.
 
double click the query component and a window pop up,
this window contains the query results column, select it and check the name of the result.
then assign this variable to yours
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top