How to Change the Data Type of an ODBC Text File Data Source

Description

ODBC defines the data type for fields used in a text data files/tables. It may be necessary to change data types in some cases. This article explains how to accomplish this.

Available data types in ODBC:

How to Change the Data Type of an ODBC Text File Data Source

  1. In Administrative Tools select ODBC Data Sources (32-bit) and then click on the System DSN tab.
  2. Select the target data source from the listing.
  3. Select Configure.



  4. Click on Options and then Select Define Format (insure that the 'Use Current Directory is UNCHECKED' so that the Define Format selection is available)

     

  5. Select the correct table from the list presented
  6. Verify the column names match the field names in the target text document.

     


  7. Select the target Column name (insure it is highlighted as shown above).
  8. Click on the Data Type drop-down and select the required data type.
  9. Click OK to apply the change.

Note:

This data type information is stored in the schema.ini file that is kept in the same directory as the text data source.
Sample 'Schema.ini' for the example above;

[lesson3.txt]

ColNameHeader=False

Format=FixedLength

MaxScanRows=25

CharacterSet=OEM

Col1=STOCKNUM Char Width 4

Col2=DESCRIPTION Char Width 13

Col3=FINISH Char Width 11

Col4=UPC Char Width 11