To set up a multi-company DSN with wildcard substitution

  1. Create a text file listing the XFD filenames for your companies. Name the file list.txt or something similar.

    For example, if your data is:

    main.xfd
    ACCT01.dat
    ACCT02.dat
    ACCT03.dat

    you might have an entry like this in list.txt:

    main#AcctTbl#Acct$$

    where main is the XFD name, AcctTbl is the table/repository name, and Acct$$ represents the indexed file name.

  2. In the configuration file, acuxdbc.cfg by default, use the FILENAME_WILDCARD variable to define the wildcards and their respective substitution characters.

    For example, the configuration file might contain:

    FILENAME_WILDCARD $$=01
  3. Create your system catalog using the -f option as shown:
    xdbcutil -d c:\data\dict -f list.txt

    When building the system catalog, xdbcutil uses the XFD "main" to create a repository table called AcctTbl.

  4. At the company site, create a single data source name (DSN) for Accounting, and point to the configuration file that contains the substitution characters for that company. See Setting Up DSNs on the Client for instructions on creating DSNs.

When a user accesses the table AcctTbl from SQL,AcuXDBC looks in the configuration file for the FILENAME-WILDCARD variable, and, substituting 01 for $$, accesses the data file, Acct01. In programming terms, when "SELECT * from AcctTbl;" is issued, it functions as if SELECT * from acct01; was entered.

There is no limit on the number of wildcards/replacements that you can use with AcuXDBC. You can change several characters in a filename, for example:

ACCT>=$$** 

where the actual filename would be ACCTZ01AA and the configuration file entry would be:

FILENAME_WILDCARD >==Z ;$$=01;**=AA

You don't have to create a list file to specify your company wildcards. If you prefer, you can specify them directly on the xdbcutil command line, like this:

xdbcutil -d c:\data\dict -x c:\data\data  -a mainxfd#AcctTbl#Acct$$
Note:

You may have to escape the wildcard characters if they are shell interpreted. For example, the sample above would not work on UNIX, because the shells interpret the $ character. You would have to use:

xdbcutil -d /data/dict -x /data/data -a mainxfd#AcctTbl#Acct\$\$

or

xdbcutil -d /data/dict -x /data/data -a "mainxfd#AcctTbl#Acct$$"