Форум: "Базы";
Текущий архив: 2002.03.21;
Скачать: [xml.tar.bz2];
ВнизКак через ADO подключится к текстовому файлу? Найти похожие ветки
← →
Yephim (2002-02-20 09:52) [0]собственно сабж. На сайте микрософта на шел следующий текст
To set up a linked server against a formatted text file:
Microsoft OLE DB Provider for Jet can be used to access and query text files.
To create a linked server for accessing text files directly without linking the files as tables in an Access .mdb file, execute sp_addlinkedserver, as in this example.
The provider is Microsoft.Jet.OLEDB.4.0 and the provider string is "Text". The data source is the full path name of the directory that contains the text files. A schema.ini file, which describes the structure of the text files, must exist in the same directory as the text files. For more information about creating a schema.ini file, see the Jet Database Engine documentation.
--Create a linked server.
EXEC sp_addlinkedserver txtsrv, "Jet 4.0",
"Microsoft.Jet.OLEDB.4.0",
"c:\data\distqry",
NULL,
"Text"
GO
--Set up login mappings.
EXEC sp_addlinkedsrvlogin txtsrv, FALSE, NULL, Admin, NULL
GO
--List the tables in the linked server.
EXEC sp_tables_ex txtsrv
GO
--Query one of the tables: file1#txt
--using a 4-part name.
SELECT *
FROM txtsrv...[file1#txt]
Как эту беду присобачить к дельфи?
И второй вопрос на засыпку, пытался присоединить файл к Ассess и что у меня получилось. если файл с расширением log то пишет не доступа read only и ни хрена не коннектится, меняю расширение на txt все работает к чему бы это?
← →
MetallAdm (2002-02-20 11:42) [1]можно так execProc
Вызываешь кокую нить процедуру
и в процедуре ентой пишешь что было выше
сказано :)
или такой вариант не устроит ??
← →
sniknik (2002-02-20 13:28) [2]строка подключения к тексту через Jet ADO
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Path;Extended Properties=Text;Persist Security Info=False
пробуй
← →
sniknik (2002-02-20 16:00) [3]И второй вопрос. Ассess работает тоже через Jet а у него (в ISAM форматах) по умолчанию ставятся:
Текстовые файлы (*.txt;*.csv;*.tab;*.asc)
для доступа к *.log меняй реестр.
← →
Yephim (2002-02-20 17:06) [4]Спасибо за ответ ваша строчка заработала !!!
Я почти и сам догадался полдня лазил в МСДНе но блин кто же знал что в микрософте 96 напишут как 60(в шестнадцитиричном коде) а буковку h не написали... с расширениями пороюсь в реестре !!!
если кто знает точную ссылку на ключ это будет клева
А так всем спасибо!!!!
← →
sniknik (2002-02-20 17:22) [5]раздел
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\ISAM Formats\Text
ключи для измены
ExportFilter
ImportFilter
на
Текстовые файлы (*.txt;*.csv;*.tab;*.asc;*.log)
Страницы: 1 вся ветка
Форум: "Базы";
Текущий архив: 2002.03.21;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.004 c