Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data from Acces database in dropdown-box

Status
Not open for further replies.

mooksemike

Technical User
Nov 4, 2000
3
NL
Hi, I've got the next question:

I've got a database made in Microsoft Acces. The database exists of 2 tables. Each table has 2 colums.
In Delphi I acces the database with ADO. Now I want to have the data from all the rows from the first table in a dropdown box, so I can select one of the rows. Is that possible? If so, how do I do it, and what components do I have to use etc.

The problem I have now is that I can only select the row selected in the ADOTable...

I hope someone can help me.

Mike
 
I'm not sure I've understand well, but:
if you should make something like put the Employee (table1) code in the Cusomer table (table2) you can use a DBLookupComboBox:

.DataSource=CustomerSrc
.DataField=Empcode
.ListSource=EmployeeSrc
.ListField=Name;Surname;AllTheFieldsYouWant
.KeyField=Code

This put the code of the Employee in the Cusomer Table.

If you want a StringList with all the records (but I don't think you want it)

Table1.First;
While Not Table1.Eof Do
Begin
MyStringList.add(Table1.FieldByNAme('FieldZZZZZ').asString;
Table1.Next;
End;

Ciao,
Geppo Darkson.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top