[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.

Question
[x]
Attachment Details

find all table in a database //  MSSQL // DELPHI // ZEOS

Asked by BdLm in Delphi Database

Tags: MSSQL DELPHI ZEOS

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;
[+][-]10/23/09 02:03 PM, ID: 25648574Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/23/09 06:41 PM, ID: 25650350Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/24/09 12:35 AM, ID: 25651188Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/24/09 07:17 AM, ID: 25652298Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/24/09 12:20 PM, ID: 25653818Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625