INF: Text Driver Needs Directory Before Define Format Enabled (124657)



The information in this article applies to:

  • Microsoft Open Database Connectivity 2.0

This article was previously published under Q124657

SUMMARY

This article discusses why you must select a directory before the Define Format button is enabled when adding a new data source for the ODBC Text Driver version 2.0.

MORE INFORMATION

When you add a text data source for the ODBC Text Driver version 2.0, you can define the format of the text files that this data source is going to be associated with. This can be done by selecting the Define Format button under Options in the ODBC Text Setup dialog box.

The text driver treats each text file as a table. Defining the format of a text file lets the driver know how many columns are there in this table, what their data types are, etc. The Define Format option is not enabled until you select Select Directory to specify the directory that is going to be used by the driver.

The reason for this can be seen by looking at how the text driver stores the format information, also called as schema information. All the schema information associated with a text data source is stored in a file called SCHEMA.INI. The requirement is that the text driver should be able to locate this file when an application connects to the text data source.

To be able to do this, the text driver needs to know during data source setup time, the directory that the text files (tables) are going to be located in. With this information, the driver will create the SCHEMA.INI file in the same directory.

If you do not specify a directory, then the driver has no way of determining at connect time where the SCHEMA.INI file is located. Hence, the driver will not allow you to define the format. As a result, Define Format is grayed out.

NOTE: This button is still grayed out when you select the Use Current Directory button. This is because Use Current Directory does not give the driver a definite directory to write the SCHEMA.INI. Although it can write SCHEMA.INI to the current directory, when an application uses the DSN, the current directory may be in another directory and the SCHEMA.INI is missing.

Modification Type:MajorLast Reviewed:6/12/2001
Keywords:KB124657