Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Assign table´s to a ComboBox linked to TDBChart

Posted on 1998-10-25
Medium Priority
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?
Question by:bert1
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

Expert Comment

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.

Author Comment

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?

Expert Comment

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.


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

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.

Accepted Solution

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);

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

Hope this is what you wanted


Expert Comment

ID: 1344223
Is there anything else I can do ?



Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

610 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