Solved

Problems with TComboBox !!!!

Posted on 2001-07-12
8
220 Views
Last Modified: 2010-04-06
How can I load on the TComboBox component one colum of a TDBGrid (I load one Table1) that I create from a DataBase (Access 97).
I only could load the first line of my Table1 with this:

cant := Form1.Table1.RecordCount;
  for  i := 0 to cant do
    Form3.List.Items.Insert(i, Form1.Table1);

I need to load each line of one colum.  Thanks.
0
Comment
Question by:matuf
8 Comments
 
LVL 22

Expert Comment

by:mnasman
ID: 6277226
Hello

  change ur code as following ,you are adding only the first record, so you need to move to the next one


cant := Form1.Table1.RecordCount -1;
 for  i := 0 to cant do
  begin
   Form3.List.Items.Insert(i, Form1.Table1);
   Form1.Table1.Next;
  end



0
 
LVL 9

Expert Comment

by:ITugay
ID: 6277232
Hi matuf,

something like this:

Table1.DisableControls;
Table1.First;
while not Table1.EOF do
begin
  ListBox1.Items.Add(Table1.Fields[3].AsString);
  Table1.Next;
end;
Table1.EnableControls;

0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 6277252
recordcount is not allways properly set,
depending on the database

better would be
table1.first;
while not table1.eof do
begin
  Form3.List.Items.add(table1.fieldbyname('fieldwhateverneeded').asstring;
  table1.next;
end;

meikl ;-)
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6277277
:-)
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:matuf
ID: 6277301
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6277422
hu,
igor didn't see your comment before now,
sorry to get a grade, which should you have get

but anyway

matuf, thanks for the points :-)
glad to be of service
good luck again

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6277425
igor, its only a c-grade :-(
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6277457
really? I miss nothing :-)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

746 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

9 Experts available now in Live!

Get 1:1 Help Now