Click here to Skip to main content
12,998,892 members (31,096 online)
Rate this:
Please Sign up or sign in to vote.
See more:
ADOConnection1.GetFieldNames('Employee', ListBox1.Items);

Above is the code that is shown that should be used when calling this method. If I try the code below, an error message comes up in the very next line of code, always.

Is there any way to replace the ListBox.Items with a StringList (which can be changed etc before placing this StringList into the ListBox)?
TablesList : TStringList;
ADOConnection1.GetFieldNames('Employee', TablesList);
//code to modify the TablesList as I want to... then display the list in the listbox
ListBox1.Items := TablesList;

I need to modify the list returned from the GetFieldNames method before it may be displayed to the user... How else can this be done?
Posted 29-Jun-12 0:05am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

// fields before you call
procedure TForm1.buttonGetFieldsClick(Sender: TObject);
  ADOConnection1.GetFieldNames(editTable.Text, memoTableFields.Lines);
// after editing you can set memo list
procedure TForm1.buttonSetFieldsClick(Sender: TObject);
  listboxFields.Items := memoTableFields.Lines;

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 27 Aug 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100