Solved

Search DB control

Posted on 1999-01-01
1
159 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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

728 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

10 Experts available now in Live!

Get 1:1 Help Now