Autor Beitrag
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Mi 11.08.04 19:08 
(ADO) Checken, ob eine Tabelle existiert bzw auslesen aller Tabellennamen - weiss jemand wie das geht ?

MFG Retnyg
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Do 12.08.04 06:55 
Hallo,

mit der Eigenschaft GetTableNames der ADOConnection, erhälst Du eine Liste aller Tabellen der gerade aktiven DB. Zu überprüfen, ob eine Tabelle existiert ist dann einfach:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
...
var sl:TStringList;
...
sl:=TStringList.Create;
try
  ADOConnection1.GetTableNames(sl);
  if (sl.IndexOf('Tabellenname')<>-1) then ShowMEssage('Tabelle vorhanden');
finally
  sl.Free;
end; // try
...

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
retnyg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Do 12.08.04 13:43 
tja bei meinem Delphi 5 Pro sind zwar die ADOXpress Komponenten nicht dabei aber ich hoffe mal dass es mit den Aloha Oi TaoADO Komponenten auch klappt, auf jedenfall mal danke !

Gruss Retnyg