Configuration Precedence

BTR2SQL uses several configuration sources to determine how the driver behaves at runtime. When the same setting appears in more than one source, the driver resolves the conflict using a fixed order of precedence. Understanding this order is essential to predictable behavior — especially in multi-directory or multi-company deployments.

Precedence Order

Settings are resolved top to bottom — the first source found wins. If a value is not found in any source, the driver uses its built-in default.

Priority

Source

Description

1

Runtime call to MdsSetSetting

Programmatic overrides made at runtime. These take the highest precedence and remain in effect until the process stops. See MdsSetSetting in the BTR2SQL SDK for details.

2

INT file

Per-table settings written during migration. Values stored in the INT file override both mds.ini and mds_global.ini.

3

mds.ini file

Per-folder settings. See MDS INI File for details.

4

mds_global.ini file

Application-wide settings. See MDS Global INI File for details.

5

Environment variables

System or user environment variables matching a setting name.

6

Registry settings (HKCU then HKLM)

Windows registry under HKEY_CURRENT_USER\SOFTWARE\Mertech Data Systems\DB Drivers\BTR\<Driver>\<version>, then HKEY_LOCAL_MACHINE.

7

Driver defaults

Built-in defaults compiled into the driver.

How INT Files and mds.ini Files Interact

Settings in the INT file override settings in the mds.ini file. This is by design — it allows you to migrate one specific table to a different server or database while all other tables continue using the mds.ini values.

During migration, the Convert Data Files dialog offers three checkboxes: Get Server Name from Login, Get Schema Name from Login, and Get Database Name from Login. When a box is checked (the default), that value is not written to the INT file — the driver will instead look for it in the mds.ini file or other sources at runtime. When a box is unchecked, the value is written directly into the INT file and will always take precedence.

Tip

A common best practice is to leave all three boxes checked during migration and store Server, Database, and Schema in the mds.ini file instead. This makes it easy to change connection details later without re-migrating.

When INT Files and mds.ini Are in the Same Folder

If the INT file and mds.ini file are both stored in the same data directory, the INT-Folder setting in the mds.ini file is ignored and settings from both files are merged. If a setting appears in both files, the INT file value takes precedence.

Example

In the example below, the mds.ini file contains INT-Folder=..\INTFILES:

C:\MyApp\Archives
  GLOBAL_DAT.int
  PROJ_DAT.int
  RESOURCE_LIB.int
  INTFILES\
    BILLING_MKD.int
    CLASS_MKD.int
    DEPT_MKD.int
    ENROLLS_MKD.int
    PERSON_MKD.int
  1999\
    mds.ini
    PERSON_MKD.int

When B_OPEN is called

The INT File read

C:\MyApp\Archives\1999\Person.mkd

C:\MyApp\Archives\1999\Person_mkd.int

C:\MyApp\Archives\1999\Billing.mkd

C:\MyApp\Archives\INTFILES\Billing_mkd.int

Because 1999\ contains its own PERSON_MKD.int, the local INT file is used for Person.mkd. For Billing.mkd, no local INT file exists, so the driver follows the INT-Folder path to INTFILES\.

Note

Only one mds.ini file is allowed per data directory.