GetTabelNames will not refresh...
Posted: 13.01.2010, 09:52
Hi!
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:
After the selection of a Catalogname in that Combobox, the next Combobox have to filled with the tablenames of the selected catalog.
Therefore i have implemented folowing Procedure in the "onSelect"-Event of the Catalog-Combobox:
The Problem: The Result is always the same. Only three Tables will displayed. Any Changes in the Catalog-Combobox do not apply to the Tablebox....
Can anybody help me?!
Thanx
Michael
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