?
Solved

Assign table´s to a ComboBox linked to TDBChart

Posted on 1998-10-25
6
Medium Priority
?
230 Views
Last Modified: 2010-04-06
I need help with assigning my table's (paradox7) to a ComboBox or a TDBLookUpComboBox and then it should be updated in my TDBChart. I want the name of my table's in the ComboBox.

Anyone can help me?
Thanks!
0
Comment
Question by:bert1
[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
  • 4
  • 2
6 Comments
 

Expert Comment

by:elkiors
ID: 1344218
Have you got the table connected to a TDataSource, you will need to do this I think.

eg. Link table1 to datasource1 then with the TDBLookupCombo point the datasource to datasource1 and then set the datafield for the table1 lookup field.

Also have a look at creating persistant lookup fields for your table, it takes a lot of pain out of creating lookups as delphi does all the linking and value assigning for you.

Let me know how you get on.
0
 

Author Comment

by:bert1
ID: 1344219
I have the table connected to a TDataSource. In the datafield in LookUpComboBox I can choose the fields in my table, but im getting a circular error when I choose one field. But I want to have the all the tables in the LookUpComboBox... not a field in my table.

You see what I mean?
0
 

Expert Comment

by:elkiors
ID: 1344220
Do you mean you want to create a list of table names to be shown in the combo ? If so let me know, and I'll post a code snippet.

Darren

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:bert1
ID: 1344221
Yes that´s what I mean and I will link them to a TDBChart that updates when I change the name in the combo. I have different graph´s in the tables.
0
 

Accepted Solution

by:
elkiors earned 150 total points
ID: 1344222
I've just realised, the code was less intensive than I thought.
Will this do

put a normal combo box on a form and add this code to the onshow event to populate the combo box with the tables in the alias you define. I got this straight from the online help, you could probably find a bit more to help with the chart and stuff.

procedure TForm1.FormShow(Sender: TObject);
var
  MyTables:TStringList;

begin
  MyTables := TStringList.Create;
  try
    Session.GetTableNames('DBDEMOS', '*.db',False, False, MyTables);
    { Add the table names to a combo box }
    ComboBox1.Items := MyTables;
  finally
    MyTables.Free;
  end;
end;

Hope this is what you wanted

Darren
0
 

Expert Comment

by:elkiors
ID: 1344223
Is there anything else I can do ?

Darren

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

765 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