Solved

Assign table´s to a ComboBox linked to TDBChart

Posted on 1998-10-25
6
227 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 50 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

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!

Question has a verified solution.

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

Suggested Solutions

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 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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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