• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

SQL

I Know the SQL statement to find data in a database.
My problem is however how can I return my data that I juse
for example in a Tedit to my SQL statement.
0
cp_st_w
Asked:
cp_st_w
  • 2
1 Solution
 
ronit051397Commented:
with Query1 do
begin
  SQL.Text:='select field1 from table1';
  Open;
  Edit1.Text:=FieldbyName('field1').AsString;
end;

0
 
cp_st_wAuthor Commented:
What SQL statement must I use and I get a error

Field not Found
0
 
ronit051397Commented:
can you post some code, so I can see what is the problem?
0
 
kretzschmarCommented:
hi cp_st_w,

an other example

with Query1 do
begin
  SQL.Text:='select CustNo, OrderNo from Orders';
  Open;
  Edit1.Text:=FieldbyName('CustNo').AsString;
  Edit2.Text:=FieldbyName('OrderNo').AsString;
end;

Other method

with Query1 do
begin
  SQL.Text:='select CustNo, OrderNo from Orders';
  Open;
  Edit1.Text:=Fields[0].AsString;  {CustNo}
  Edit2.Text:=Fields[1].AsString;  {OrderNo}
end;

i agree with ronit, post some code

meikl
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now