Solved

Search DB control

Posted on 1999-01-01
1
166 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

707 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