Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2009.03.29;
Скачать: CL | DM;

Вниз

Список таблиц   Найти похожие ветки 

 
9899100   (2008-07-31 11:05) [0]

Подскажите пожалуйста, возможно ли получить список таблиц при использовании ODBC и ADO, если не известно к какому типу данных коннектиться ADO.
Т.е. например есть разные источники данных, MDB, DBF (а может и другие типы). Программа соеденяеться с ними через ODBC надо получить список таблиц.


 
Ega23 ©   (2008-07-31 11:12) [1]


The example below fetches a list of all tables in an ADO data store. It then traverses this list, making an entry in another table with each table’s name and number of records.

procedure TForm1.Button1Click(Sender: TObject);

var
 SL: TStrings;
 index: Integer;
begin
 SL := TStringList.Create;
 try
   ADOConnection1.GetTableNames(SL, False);
   for index := 0 to (SL.Count - 1) do begin
     Table1.Insert;
     Table1.FieldByName("Name").AsString := SL[index];
     if ADOTable1.Active then ADOTable1.Close;
     ADOTable1.TableName := SL[index];
     ADOTable1.Open;
     Table1.FieldByName("Records").AsInteger := ADOTable1.RecordCount;

     Table1.Post;
   end;
 finally
   SL.Free;
   ADOTable1.Close;
 end;
end;


?


 
9899100   (2008-07-31 11:35) [2]

Сенкс :)


 
MsGuns ©   (2008-08-01 12:29) [3]

>Ega23 ©   (31.07.08 11:12) [1]

Откуда это страхиття ? Неужто их хелпа ?


 
Ega23 ©   (2008-08-01 12:57) [4]


> Откуда это страхиття ? Неужто их хелпа ?


Ага.
TADOConnection.GetTableNames + F1 -> example.



Страницы: 1 вся ветка

Текущий архив: 2009.03.29;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.024 c
2-1233154226
Scot Storch
2009-01-28 17:50
2009.03.29
наследник TForm


3-1217487936
9899100
2008-07-31 11:05
2009.03.29
Список таблиц


6-1200643073
Andrewtitoff
2008-01-18 10:57
2009.03.29
Как правильно послать файл через TcpServer & TcpClient ?


2-1233341544
CodeMaster
2009-01-30 21:52
2009.03.29
Свойство Parent


2-1234270641
Alex_Ford
2009-02-10 15:57
2009.03.29
Ping - Программно