Trying to export DAT files to EXCEL/ASCII/SQL ETC.

Posted on 2008-11-03
Last Modified: 2012-05-05
I have a program that is not longer available.  I need to put the data into an SQL database.  Before I can do that, I need to be able to export the data.  I am looking for a utility/code to be able to do this.  Here is a sample.
Question by:bmsjeff
    LVL 14

    Author Comment

    Here is a sample.  Extension is really .DAT
    LVL 28

    Accepted Solution

    These files are Btrieve files.  The one you sent has the specifications below.

    Btrieve files can either be very easy or very hard to access from ODBC.  To get information about extracting these, please see the white paper on Accessing Btrieve Files from ODBC, found here:

    If you have questions about this process, please let me know, and I'll be glad to provide additional information.

    C:\Download>butil -stat inven00.dat
    Btrieve Maintenance Utility
    Copyright (C) Pervasive Software Inc. 2008
    All Rights Reserved.
    File Statistics for inven00.dat
    File Version = Prior to version 6.00
    Page Size = 1536
    Page Preallocation = No
    Key Only = No
    Extended = No
    Total Number of Records = 6833
    Record Length = 200
    Record Compression = No
    Page Compression = No
    Variable Records = No
    Available Linked Duplicate Keys = 0
    Balanced Key = No
    Log Key = 0
    System Data = No
    Total Number of Keys = 8
    Total Number of Segments = 11
    Key         Position        Type            Null Values*               ACS
        Segment          Length           Flags              Unique Values
      0    1         1      14  String       M      --              6833    --
      1    1        15      30  String       MD     --              5900    --
      2    1        49      12  String       MD     --                 6    --
      3    1        45       2  Integer      M      --              6833    --
      3    2         1      14  String       M      --              6833    --
      4    1        47       2  Integer      M      --              6833    --
      4    2         1      14  String       M      --              6833    --
      5    1       174       7  String       MD     --                 1    --
      6    1       157       2  Integer      M      --              6833    --
      6    2         1      14  String       M      --              6833    --
      7    1       181      14  String       MD     --               349    --
     < = Descending Order
     D = Duplicates Allowed
     I = Case Insensitive
     M = Modifiable
     S = Supplemental Index
     A = Any Segment (Manual)
     L = All Segments (Null)
     * = The values in this column are hexadecimal.
    ?? = Unknown
    -- = Not Specified
    The command completed successfully.

    Open in new window

    LVL 14

    Author Comment

    I have created and tested the ODBC connection I created from the link you provided, but am unsure what step should be next.

    Should I use a specific program to import?
    LVL 28

    Expert Comment

    by:Bill Bach
    If you had DDF's, and you created an ODBC data source, then you should be able to pull the data directly into SQL Server via DTS/SSIS.  If you are going into some OTHER SQL database, then you may find it best to export the data (which you can do with the Pervasive Control Center, or another ODBC-based tool like SQLExec) to a comma-delimited format, which just about any database can handle as an import file.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
    Creating and Managing Databases with phpMyAdmin in cPanel.
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now