I have a Problem with the Function "GetTabelNames".
I don't Know who to Change the TabelNames when i select another Catalog.
My Example:
I have two Comboboxes. The first combobox represents the Cataloges, the second Combobox represents the Tables of the Selected Catalog.
The Selection of the first Combobox is filled with the following routine:
Code: Select all
zConnection1.Protocol:=ProtokollComboBox.Text;
zConnection1.HostName:=HostnamenEdit.Text;
zConnection1.User:=userEdit.Text;
zconnection1.Password:=passwordEdit.text;
if zconnection1.Connected then
Begin
zConnection1.connected:=false;
DBConnectLBL.Caption:='Nicht Verbunden...';
jvconnectLED.Status:=false;
katalogcombobox.items.Clear;
tablecombobox.items.clear;
end
else
Begin
zConnection1.connected:=true;
DBConnectLBL.Caption:='Verbunden...';
jvconnectLED.Status:=True;
zconnection1.GetCatalogNames(katalogcombobox.items);
end;
Therefore i have implemented folowing Procedure in the "onSelect"-Event of the Catalog-Combobox:
Code: Select all
procedure TForm1.KatalogComboBoxSelect(Sender: TObject);
begin
// showmessage('Select gewählt');
if zconnection1.Connected then
Begin
zconnection1.Catalog:=KatalogCombobox.Text;
tablecombobox.Items.Clear;
zconnection1.DbcConnection.GetMetadata.ClearCache;
zconnection1.Reconnect;
zconnection1.GetTableNames('','',tablecombobox.items);
end;
end;
Can anybody help me?!
Thanx
Michael