Difference between revisions of "DBF Files"

From PeformIQ Upgrade
Jump to navigation Jump to search
(Created page with " =DBF File Links= =FPT File Links= * http://fox.wikis.com/wc.dll?Wiki~TableCorruptionRepairTools Category:DBase VCategory:VisualFoxPro")
 
Line 5: Line 5:
=FPT File Links=
=FPT File Links=


* https://go4answers.webhost4life.com/Example/read-fpt-file-binary-header-91321.aspx
==Code==
<pre>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
privatestruct DBTHeader
{
    publicInt32 nextBlockID;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
    public byte[] reserved1;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
    public string fileName;
    public byte version; // 0x03 = Version III, 0x00 = Version IV
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
    public byte[] reserved3;
    publicInt16 blockLength;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 490)]
    public byte[] reserved4;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
privatestruct MemoHeader
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
    public byte[] reserved;
    publicInt16 startPosition;
    publicInt32 fieldLength;
}
</pre>
You may also view the DBT/FPT file  in hexadecimal format in VFP:
  DO HOME()+'\tools\hexedit\hexedit.app' WITH 'YourFile.FPT'
=Tools=
* http://mac.softpedia.com/get/Developer-Tools/DBF-Viewer.shtml
* http://fox.wikis.com/wc.dll?Wiki~TableCorruptionRepairTools
* http://fox.wikis.com/wc.dll?Wiki~TableCorruptionRepairTools


[[Category:DBase]]
[[Category:DBase]]
[[VCategory:VisualFoxPro]]
[[Category:VisualFoxPro]]

Revision as of 08:43, 7 February 2015

DBF File Links

FPT File Links


Code

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
privatestruct DBTHeader
 {
    publicInt32 nextBlockID;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
    public byte[] reserved1;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
    public string fileName;
    public byte version; // 0x03 = Version III, 0x00 = Version IV
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
    public byte[] reserved3;
    publicInt16 blockLength;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 490)]
    public byte[] reserved4;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
privatestruct MemoHeader
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
    public byte[] reserved;
    publicInt16 startPosition;
    publicInt32 fieldLength;
}


You may also view the DBT/FPT file in hexadecimal format in VFP:

 DO HOME()+'\tools\hexedit\hexedit.app' WITH 'YourFile.FPT'

Tools