|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by BdLm in Delphi Database
would like to find all tables in a database, these two code fragments did not work, can someone post a solution for that.
code should be almost good :-))
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
|
/ methode #2
procedure TForm1.BitBtn2Click(Sender: TObject);
var Query:TZQuery;
begin
Query:=TZQuery.Create(Self);
Query.Connection := MSSQL_ZConnection;
Query.SQL.Add('show tables');
try
Query.Open;
while(not Query.Eof) do
begin
memo1.Lines.Add(Query.Fields[0].AsString);
Query.Next;
end;
finally
Query.Close;
Query.Free;
end;
end;
// methode #1
procedure TForm1.BitBtn1Click(Sender: TObject);
var aTableList : TStringList;
begin
aTableList := TStringList.Create;
MSSQL_ZConnection.GetTableNames( '%', aTableList);
memo1.Lines.AddStrings(aTableList);
memo1.Lines.Add('Nr ' + IntToStr( aTableList.Count ) );
aTableList.Free;
end;
|
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625