Текущий архив: 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.44 MB
Время: 0.034 c