How to LINK PROISAMD.LIB to .EXE Even if SETUP "ISAM in TSR" (63834)



The information in this article applies to:

  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.0
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2 7.1

This article was previously published under Q63834

SUMMARY

The following technique gives you the setup configuration with the greatest flexibility of choice for ISAM support (as either a TSR [terminate-and-stay-resident] program or linkable .LIB) in compiled .EXE programs.

If you chose "ISAM Routines in TSR" (instead of "ISAM Routines in LIB") when you ran SETUP.EXE, then to make a standalone .EXE program (that uses ISAM) that does not require the PROISAMD.EXE or PROISAM.EXE TSR program, you must LINK with the PROISAMD.OBJ and PROISAMD.LIB component libraries in the linker's object list. This technique requires that you choose to retain component libraries when you run SETUP.EXE.

This information applies to Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS and to Basic PDS version 7.1 for OS/2.

MORE INFORMATION

With Basic PDS 7.0, there are four SETUP.EXE options for installing ISAM support for compiled .EXE programs:
  1. ISAM Routines in TSR
  2. ISAM Routines in LIB, Support Database Creation and Access
  3. ISAM Routines in LIB, Support Database Access Only
  4. No ISAM support
Only option 1 creates PROISAM.EXE and PROISAMD.EXE TSR programs that can be used with Basic compiled .EXE programs. The TSR program created in option 1 can also be used in QBX.EXE. Option 1 is the default because it consumes the least disk space.

Options 2 and 3 create PROISAM.EXE and PROISAMD.EXE TSR programs that CANNOT be used in compiled .EXE programs and that can only be used by QBX.EXE and the ISAM utilities (ISAMIO.EXE, ISAMCVT.EXE, ISAMREPR.EXE, and ISAMPACK.EXE). If you choose Option 2 or 3 and you want ISAM support in your .EXE program, you must link to the ISAM .LIB files instead of using the TSR support for ISAM.

SETUP Option 4 does not copy any ISAM-related files onto your computer.

You may want to have the option of creating .EXE programs with full ISAM support provided either in the TSR program or linked from libraries. This can be accomplished by choosing Option 1 ("ISAM Routines in TSR") and LINKing with PROISAMD.OBJ and PROISAMD.LIB in the object list, as follows:
   LINK /NOE ISAMPROG.OBJ+PROISAMD.OBJ+PROISAMD.LIB;
				
The following are some important notes about the above LINK command line:
  • The NOExtended library search option (/NOE) is necessary to prevent "Symbol Defined More than Once (L2025)" errors.
  • Both object (PROISAMD.OBJ) and library (PROISAMD.LIB) files are required to LINK properly.
  • The PROISAMD.OBJ is normally deleted with component libraries by SETUP.EXE. You must choose to retain component libraries when you run SETUP.EXE to retain this necessary file.
  • PROISAMD.LIB must be specified in the object list instead of the library list on the LINK command line, as shown. (When LINKing a library in the object list, all object files contained in that library are LINKed into the EXE, as opposed to only the routines that are not otherwise resolved.)
  • ISAMPROG.BAS must be compiled with the BC /O (standalone) option. If you don't compile with BC /O, then the LINK error L2029 "Unresolved external" error will occur for 'b$IsamRtmUsed' and 'B$DOS3CHECK'.
The following code example would normally require the PROISAMD.EXE TSR program (when the "ISAM Routines in TSR" option is chosen during SETUP), but using the LINK line given below, the TSR program is not necessary. Compile and link the code example as follows:
   BC ISAMPROG /O;
   LINK /NOE ISAMPROG.OBJ+PROISAMD.OBJ+PROISAMD.LIB;
				

Code Example

' Name this source file as follows: ISAMPROG.BAS
TYPE test
  x AS INTEGER
END TYPE
OPEN "ISAMFILE" FOR ISAM test "table" AS #1
CLOSE #1
END

Modification Type:MajorLast Reviewed:10/23/2003
Keywords:KB63834 kbAudDeveloper