Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

delphi 8 listbox-populating

I am using delphi 8 in a databse application.Using winforms.How do I retrieve the database name and tablenames to display in list box's?????
0
ColinAlchin
Asked:
ColinAlchin
  • 2
1 Solution
 
Mohammed NasmanSoftware DeveloperCommented:
Hello

  Start new VCL .Net application, drop Session component from BDE, and two listboxes and one button

ListBox1 will show all the aliases, when you click on anyone like DBDEMOS it will show you the tables on the ListBox2

procedure TForm1.Button1Click(Sender: TObject);
begin
  Session1.GetDatabaseNames(ListBox1.Items);
end;

procedure TForm1.ListBox1Click(Sender: TObject);
begin
  ShowMessage(ListBox1.Items[ListBox1.ItemIndex]);
  Session1.GetTableNames(ListBox1.Items[ListBox1.ItemIndex],'*.*',True,True,ListBox2.Items);
end;

HTH

Regards,
Mohammed
0
 
krypto2000Commented:
I think the problem is not the code because I've copied exactly the same in my application and it work fine !!

Check your connections strings...
0
 
Mohammed NasmanSoftware DeveloperCommented:
points to me
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now