Solved

SQL

Posted on 1998-11-26
4
137 Views
Last Modified: 2010-04-04
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
Comment
Question by:cp_st_w
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
ronit051397 earned 50 total points
ID: 1348176
with Query1 do
begin
  SQL.Text:='select field1 from table1';
  Open;
  Edit1.Text:=FieldbyName('field1').AsString;
end;

0
 

Author Comment

by:cp_st_w
ID: 1348177
What SQL statement must I use and I get a error

Field not Found
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1348178
can you post some code, so I can see what is the problem?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1348179
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

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now