Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Field Names using Text Driver

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-05-19 : 07:21:09
Scott writes "I have created an ADO connection to a directory using the Microsoft Text Driver. The .txt files I am using as tables do not have a header row but I need to use MAX and MIN functions in my query. How do I reference the columns, I'd guess by index?"

Tim
Starting Member

392 Posts

Posted - 2003-05-20 : 01:31:31
Open the Data Sources manager, select your driver and click configure.

Next, click the "options" button and then the "define format" button.
Highlight the text file you want to use and click "Guess" button.

The fields will then be named F1, F2 etc and your source file will be unchanged.

You can then reference these field names in ADO and in SQL commands you pass to the datasource.

You can also define your columns here with names you choose if you want more meaningful than "F?" or if you want to force data types.

In both cases a file called schema.ini is created in the data source's directory. Have a look in Notepad, you can just work directly with this file.

You might need a separate directory for each text file format (multiple files with same format is ok) if you do this.

works for Microsoft Text Driver 4.00.6019.00, ODBCJT32.DLL, 4/05/2001


Go to Top of Page
   

- Advertisement -