How to Map Btrieve Files to FairCom BTRV Files
Btrieve applications frequently use alternate filename extensions causing failures to find files by default by BTRV.
The "missing index" error occurs because the configuration leads the system to look for an incorrect index filename. Specifically, it searches for myTable.MKD.idx
instead of the actual file, myTable.idx
.
The solution requires a two-part change to the configuration: you must explicitly define .MKD
as the data file suffix and simultaneously instruct the system not to append this suffix if the filename already includes it.
## Root Cause
The issue stems from how RTG constructs the index filename based on the provided configuration.
-
Application Request: The application passes the full data filename,
C:\FairCom\Actian\Empty\myTable.MKD
. -
Configuration Rule: Your configuration includes
<datafilesuffix></datafilesuffix>
, which tells the system that data files have no extension. -
Filename Interpretation: Because the data suffix is defined as empty, the system treats the entire filename passed by the application,
myTable.MKD
, as the base name of the file. -
Index Name Construction: The system then appends the index suffix (
<indexfilesuffix>.idx</indexfilesuffix>
) to this perceived base name. -
Resulting Error: This results in a search for
myTable.MKD
+.idx
which ismyTable.MKD.idx
. Since this file does not exist, the system returns the 44:12:2 error.
## Solution
To resolve this, you must update the <datafilesuffix>
element to correctly identify the file extension and handle how it is applied. Since your application is already sending the complete filename with the extension (myTable.MKD
), it is critical to prevent the system from appending the suffix a second time.
Corrected Configuration
Update the <datafilesuffix>
tag in your instance configuration as follows. This change is necessary for a correct and robust implementation.
<instance server="FAIRCOMS" user="admin" password="ADMIN">
<indexfilesuffix>.idx</indexfilesuffix>
<datafilesuffix append="n">.MKD</datafilesuffix>
<file dir="C:\FairCom\Actian\Empty\*" casesensitive="no">
<map>
<dir>./</dir>
</map>
</file>
</instance>
Explanation of the Fix
This single line provides the two necessary instructions:
-
<datafilesuffix>.MKD</datafilesuffix>
: This part informs the system that files ending in.MKD
are data files. This allows it to correctly parsemyTable
as the base filename, which is the first step to findingmyTable.idx
. -
append="n"
: This attribute is essential. It tells the system: "If the filename provided by the application already ends with the specified suffix (.MKD
), do not append it again." This prevents the system from creating an incorrect filename likemyTable.MKD.MKD
and ensures the logic works as intended.