Solved

Assign table´s to a ComboBox linked to TDBChart

Posted on 1998-10-25
6
221 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
  • 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

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 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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

13 Experts available now in Live!

Get 1:1 Help Now