Solved

Search DB control

Posted on 1999-01-01
1
162 Views
Last Modified: 2010-04-04
how do i search through the controls in the form and access the property of the component TQuery,TDataSource and TTable, the following code is just apply to Component that is under TControl but how about Database component like TQuery,TDataSource and so on. ?

for i := 0 to form1.controlcount -1 do
  if controls[i] is TEdit then
      dosomething
 
0
Comment
Question by:dumper
1 Comment
 
LVL 17

Accepted Solution

by:
inthe earned 20 total points
ID: 1354105
If I understand correctly use ComponentCount Instead

procedure TForm1.Button1Click(Sender: TObject);
Var I : Integer;
begin
for i:=0 to Form1.ComponentCount -1 do
if components[i] is tdatasource then
Datasource1.enabled:=false;
end;

Regards Barry
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Using idhttp to login to instagram 2 89
Delphi Yen format 3 34
Delphi problems to abort a printjob 9 19
How to Get Images From Server using App Tethering 11 26
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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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