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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outputting query results

Status
Not open for further replies.

doorbreaker

Programmer
Nov 19, 2002
91
GB
Hello,

I am doing the following query....

sqlquery2.Open;
sqlquery2.SQL.Clear;
sqlquery2.SQL.Add(
'select * from so_oem_lookup ' +
'where oemnumber = "'+oemnumber+'" ' +
'and sonumber = 112 ' +
'and qtyneeded = "'+inttostr(qty)+'" ');

How do I output the query results into a listbox??

Hope you can help

Chris Moore

 
You just need to run through the queries results adding them to your listbox.
Code:
sqlquery2.First;
Listbox1.Items.Clear;
repeat
  Listbox1.Items.Add(sqlquery2.FieldByName('YOURFIELD').AsString);
  sqlquery2.Next;
until sqlquery2.EOF = True;
sqlquery2.Close;


When your feeling down and your resistance is low, light another cigarette and let yourself go [rockband]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top