Reading CSV Files with the Microsoft Text Driver: What It Changes and When to Use It

How the Microsoft Text Driver reads CSV and TSV files through ODBC or OLE DB, what it does to your data along the way, and when a plain-text approach is safer.

The Microsoft Text Driver is a Windows data access component that lets programs query delimited text files, such as CSV and TSV, with SQL as if they were database tables. It is available as an ODBC driver and through the Jet and ACE OLE DB providers used by Access, Excel, VBA, SSIS and older .NET code. Despite the name, it is not a font, printer or text-styling driver. It reads text files and returns their contents as rows and typed columns.

This review explains what the driver actually does to your data, where the result can differ from the file, and when reading the file as plain text or with a dedicated CSV parser is the better choice. No benchmark data or scoped test results were supplied for this article. The behavior described below comes from documented driver conventions and general principles, and the uncertain points are flagged as such.

Is the Text Driver suitable for your use?

The driver is a reasonable choice when you need to read well-formed, consistently structured CSV or TSV files from an existing Windows tool that already speaks ODBC or OLE DB, and you can control the column definitions. Its main benefit is that you can filter, join and aggregate flat files with SQL without importing them into a database first.

The decisive tradeoff is interpretation. The driver does not hand you the text as written. It parses the file and guesses a data type for each column unless you tell it otherwise. That guess can silently change values, for example by dropping leading zeros or returning blanks for entries that do not match the inferred type.

Reading the file as plain text, or with a purpose-built CSV library, is usually preferable in these situations:

  • Exact string preservation matters, as with postal codes, account numbers, product codes or long numeric IDs.
  • The file layout varies between deliveries, or comes from a source you do not control.
  • The data contains quoted fields with embedded line breaks, mixed encodings or non-Western scripts that you cannot first test against the driver.
  • The process must run outside Windows, or on machines where you cannot install or match driver bitness.
  • You need to update or delete rows in place rather than only read or append.

How the driver maps files to tables

The driver treats a folder as the database and each text file in it as a table. You point the connection at a directory, then name the file in the FROM clause. Typical connection forms look like this, with the folder path replaced by your own:

ODBC:
Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=C:\Data\Imports\;Extensions=asc,csv,tab,txt;

OLE DB (ACE):
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Data\Imports\;Extended Properties="text;HDR=Yes;FMT=Delimited";

Query:
SELECT * FROM [orders.csv] WHERE Region = 'West'

Square brackets around the file name avoid problems with the period before the extension. File names that contain additional periods or unusual characters are a common source of errors, so simple names are the safer convention.

What the driver actually changes

A plain read does not modify the file on disk. The change happens in the result set your program receives. The driver splits lines into fields, decides whether the first row is a header and assigns each column a type. Values are then converted to that type using the machine's regional settings. The characters in the file stay the same, but what your application sees is an interpretation of them.

File characteristic | What the driver does | Practical risk
First row holds column names | Uses it as headers when HDR=Yes or ColNameHeader=True | Wrong setting shifts headers into data or loses the first record
No explicit column types | Scans a limited number of leading rows to guess types | Values later in the file that do not fit the guess may come back empty
Codes with leading zeros | May infer a numeric type | 00123 becomes 123
Long numeric identifiers | May infer a floating-point type | Digits beyond floating-point precision can be altered
Dates and decimals | Parsed using regional settings | The same file can read differently on machines with different locales
Non-comma delimiters | Need FMT=Delimited(x), TabDelimited or schema.ini | Without them a semicolon or tab file may load as a single column

Mixed-type columns cause the most surprises. If the sampled rows look numeric and a later row contains text, that cell can be returned as null rather than raising an error. Because the failure is silent, it can pass unnoticed unless you compare row counts or spot-check values against the source.

Controlling interpretation with schema.ini

The documented way to remove guessing is a schema.ini file placed in the same folder as the data. Each section is named after a file and declares its format, header handling and column types. Declaring identifier columns as Text is the most direct way to keep values like codes and ZIP-style numbers intact.

[orders.csv]
Format=CSVDelimited
ColNameHeader=True
MaxScanRows=0
CharacterSet=ANSI
Col1=OrderID Text
Col2=CustomerCode Text
Col3=OrderDate DateTime
Col4=Amount Double

[export.tsv]
Format=TabDelimited
ColNameHeader=True

[european.csv]
Format=Delimited(;)
ColNameHeader=True

MaxScanRows controls how many rows are sampled when types are not declared. A value of 0 asks the driver to scan the whole file. Explicit column definitions remain more reliable than any amount of scanning, because they do not depend on what happens to appear in the data.

Encoding and character handling

Schema.ini documents CharacterSet values of ANSI and OEM. Specifying a Unicode code page such as 65001 for UTF-8 is widely used, but behavior with byte order marks and multibyte characters is not uniformly documented across driver versions. No test results were supplied for this article. If your files contain accented letters, non-Latin scripts or emoji, verify the output against the source before relying on the driver, paying particular attention to the first column name and to any text near the start of the file.

Quoted fields that contain commas are handled by the standard CSV format. Quoted fields that contain line breaks are a known weak point in many older text parsers. Test them with your actual data rather than assuming they will round-trip correctly.

Will the results stay usable after export or sharing?

Once data passes through the driver, it carries the driver's type decisions. If you write query results to a new CSV, a spreadsheet or a database, any lost leading zeros, reformatted dates or nulled cells travel with it, and the original text cannot be recovered from the output. Keep the source file unchanged alongside any derived copy, and treat the driver's output as a transformed view rather than a faithful copy.

Writing is limited. The driver supports creating text tables and appending rows with INSERT, but it does not support UPDATE or DELETE against text files. Workflows that need to edit records in place should load the data into a real database or process the file as text.

A plain-text equivalent is needed whenever someone downstream must see the values exactly as delivered, for example for auditing, reconciliation with another system or legal records. In those cases, read the file as text first, or declare every column as Text in schema.ini, and convert types deliberately afterward.

Compatibility limits

  • Windows only: the driver is part of the Windows and Office data access stack and is not available on other platforms.
  • Bitness must match: a 32-bit application needs a 32-bit driver and a 64-bit application needs a 64-bit driver. The legacy Jet text driver is 32-bit; 64-bit use generally requires the Microsoft Access Database Engine redistributable.
  • Installation conflicts: an existing Office installation of the opposite bitness can block installing the matching Access Database Engine package.
  • Settings outside the file: default format and scan behavior can come from registry values, so two machines can parse the same file differently unless schema.ini pins the settings down.

Checks before relying on the driver

  • Compare the row count returned by the driver with the line count of the file, allowing for the header row.
  • Spot-check columns that hold codes, IDs or dates against the raw text.
  • Search the results for unexpected nulls in columns that should always be filled.
  • Run the same query on a second machine or account with a different regional setting if the data will be processed in more than one place.
  • Commit schema.ini alongside the data or deployment so column types do not depend on guessing.

Bottom line

The Microsoft Text Driver is a practical way to run SQL over consistent CSV and TSV files from Windows tools that already use ODBC or OLE DB, provided you declare column types in schema.ini and verify encoding with your own data. It is the wrong tool when exact text preservation, varied layouts, in-place edits or cross-platform use matter more than convenience. In those cases, read the file as plain text or use a dedicated CSV parser.