Home/Legacy Systems/Open Btrieve Files
Guide · Btrieve & Pervasive

How to open Btrieve files

Btrieve files won't open in Excel or Access. Here's what you need to read .DAT and .BTR files, how to see what's inside, and how to get the data out without damaging anything.

Btrieve files won't open in Excel, Access or a text editor, and that confuses a lot of people. The data is there, but it's stored in a format only the database engine understands, and the file itself doesn't say what the fields mean. Here's what you need to read one, and how to get useful data out.

Is it really a Btrieve file?

Btrieve files commonly end in .DAT, .BTR or .MKD, but an application can use any extension it likes, or none at all. Signs you're looking at a Btrieve or Pervasive database:

  • The folder also contains FILE.DDF, FIELD.DDF and INDEX.DDF.
  • The software's installer or documentation mentions Btrieve, Pervasive, PSQL or Actian Zen.
  • With an engine installed, butil -stat filename returns the file's structure instead of an error.

Why Excel and Access can't open them

A Btrieve file is a set of fixed-size pages managed by the database engine. Inside, each record is a run of raw bytes. There are no column names or data types in the file itself. That information lives in the application's code or in separate DDF files. So even once you can read the records, you still need a map of the fields to make sense of them.

What you need

  1. A copy of the files. Always work on a copy, never the originals.
  2. A Pervasive or Actian Zen engine. For a one-time look, a workgroup engine on a single PC is enough. Newer engines can read most older file formats.
  3. The field layouts, ideally in the form of DDF files. Without them, you'll see records but not what the fields mean.

Option 1: Browse with DDFs

If you have DDF files, this is the easy route:

  1. Copy the data files and DDFs together into one folder.
  2. In Pervasive Control Center or Zen Control Center, create a new database pointing at that folder.
  3. Open the database. The tables defined in the DDFs appear, and you can browse them, run SQL queries, and export results.
  4. For Excel, create an ODBC data source for the database, then use Data → Get Data → From ODBC.
Common snag

FILE.DDF stores the path of each data file. If the files were moved, tables may appear but fail to open with status 12 ("file not found"). The fix is to correct the paths in the dictionary, or to recreate the folder structure the DDFs expect.

Option 2: Look at the raw records

Without DDFs, you can still look inside:

  • butil -stat shows the record length, record count and key definitions.
  • Function Executor, a tool included with the engine, opens a file and lets you step through records one at a time, showing the bytes as hex and text.
  • butil -save dumps every record to a sequential file for analysis.

Text fields are usually readable right away. Numbers, dates and money amounts will look like gibberish until they're decoded. Our Btrieve to SQL guide covers the common field types and how to map them.

Errors you might see

StatusWhat it usually means when opening a file
2I/O error. The file may be damaged or was copied incompletely.
12File not found. Usually a wrong path, often from DDFs pointing at an old location.
20The database engine isn't running or can't be reached.
30Not a MicroKernel file. It isn't a Btrieve file, it's damaged, or the format is very old.
46Access denied. The file may be marked read-only, which is common after copying from a backup or disc.
51Invalid owner name. The file is password-protected, and may be encrypted.
94Permission error. Windows folder or share permissions are blocking access.

For more status codes, see the common Pervasive and Btrieve errors on our legacy systems page.

Getting the data into Excel or SQL

Opening the file is only the first step. To actually use the data, you'll need to map every field, decode dates and amounts, and export to a format your new tools can read. The Btrieve to SQL guide walks through the full process, and if you're deciding what should come after the old system, see Btrieve replacement options.

Stuck, or short on time?

We've supported Pervasive/Btrieve databases and VB6 applications in production for about 15 years. Tell us what you're working with and we'll tell you where it stands. Every job starts with a fixed-price assessment.

Describe your system

Tell us about your system. We'll tell you where it stands.

A few sentences is plenty. The software name, roughly how old it is, and what's going wrong. You'll hear back from a real person, not a ticket queue.

Based inSavannah, Georgia
ServingBusinesses across the U.S., remotely
Reply timeUsually within one business day