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

Delphi database locating

Status
Not open for further replies.

Judder

Programmer
Joined
Mar 4, 2001
Messages
7
Location
GB
Ok, i have used the locate procedure to find a value, say staff_id. I then want to another value relating to that staff_id. The only way i can think of describing it is by showing you this picture......

untitled.jpg


So ive found staff_id and i want staff_level as well.
 
Locate can find more than one value at a time:

query.locate('staff_id;staff_level',VarArrayOf([id, level]),[]);

Hope that helps
TealWren
 
but i want to adotable1.locate('staff_username',edit1.text,[]) then i want to say that if staff_level> "a value" then "do somthing"

Do i have to use paramaters and use SQL?
 
Using a query in the SQL property key down:

SELECT staff_id, staff_level
FROM STAFF
where staff_username Like :SearchString

In the Onchange event of edit1 key in

begin
Adoquery.close;
ParamByName('SearchString').AsString := edit1.text;
Adoquery.open;
if Adoquery.FieldByName('staff_level').asString = ...
then blabla
end;

Hope this helps S. van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top