Solved

Search DB control

Posted on 1999-01-01
1
163 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to renew a Delphi rad-studio licence? 5 69
LAN or WAN ? 11 95
can't find the executable in Simulator 1 100
Microsoft Access 97 and Delphi XE2 9 54
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

856 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