Setting Up the nsqlprep Precompiler

Embedded SQL for C and SQL Server

Embedded SQL for C and SQL Server

Setting Up the nsqlprep Precompiler

Before you run the nsqlprep precompiler, do the following:

The nsqlprep precompiler uses your compiler to process header files

  • Set the INCLUDE environment variable to include the full path where the Sqlca.h and Sqlda.h ESQL/C header files are located and set the LIB environment variable to include the full path where the library files are located. There are several ways to accomplish this, including either:
    • Issuing a SET statement at the command prompt, such as

      SET INCLUDE = C\Mssql17\DevTools\INCLUSE; %include%

      SET LIB = C\Mssql17\DevTools\LIB; %LIB%

    • At the command prompt, first running Vcvar32.bat (in the \Program Files\Microsoft Visual Studio\VC98\Bin directory) and then running setenv.bat (in \Mssql17\DevTools\Samples\Esqlc directory).

    The nsqlprep precompiler automatically includes these header files in the C programs it creates. Do not explicitly include them (by using #include) in an Embedded SQL program.

  • To enable communication with Microsoft® SQL Server™ 2000, ensure that an appropriate Net-Library is loaded or available on the path when precompiling with the /DB and /PASS options. For example, the Named Pipes Net-Library for the Microsoft Windows NT® operating system (Intel® platform) is Dbnmpntw.dll, and the Named Pipes Net-Library for the Microsoft MS-DOS® operating system is the Dbnmpipe.exe TSR.