Export (0) Print
Expand All

Compiling and Linking Embedded SQL Applications

SQL Server 2000

The nsqlprep precompiler creates a C program with the file extension .c from an Embedded SQL for C (ESQL/C) program. For example, from the ESQL/C program Myprogrm.sqc, nsqlprep creates a C program named Myprogrm.c. You can compile the C program for the Intel® platform by using the appropriate C compiler.

The ESQL/C precompiler does not support preprocessing of C++ modules. To use Embedded SQL in a C++ application, you must create separate C-language modules for data access functions and preprocess only those modules. ESQL/C also does not support the use of precompiled headers because the first step in preprocessing is to expand all #include files. You can improve compilation time by segregating data access code into .sqc modules that have a minimum number of #include files.

If your program contains a #include windows.h statement, you must precede it with the following two statements:

#define _OLE2_H_
#define NOIME

In this example, the Ole2.h and Imm.h header files are excluded. The Ole2.h and Imm.h header files are not compatible with version 6.5 of ESQL/C.

The Transact-SQL keyword null should not be uppercase in Embedded SQL programs to avoid conflict with the C keyword NULL. Also, the Embedded SQL keyword delete and the Transact-SQL keyword in should not be uppercase in applications for 32-bit Windows to avoid conflict with 32-bit Microsoft Windows®-defined constants in Windows.h.

Show:
© 2014 Microsoft