Project Settings for Visual C++

Embedded SQL for C and SQL Server

Embedded SQL for C and SQL Server

Project Settings for Visual C++

The following project settings enable application development in Microsoft® Visual C++®. The techniques discussed apply to any integrated development environment. For more information about a specific manufacturer's compiler and integrated development environment, see the compiler documentation.

You set up ESQL/C projects in the same way you set up projects that include any additional component libraries.

To add the needed directory names to Visual C++ environment settings

  1. On the Tools menu, click Options.

  2. Click the Directories tab.

  3. In the Show directories for box, click Include files.

  4. Enter the path for Microsoft® SQL Server™ 2000 development include files, typically x:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Include.

  5. In the Show directories for box, click Library files.

  6. Enter the path for SQL Server development library files, typically x:\Program Files\Microsoft SQL Server\80\Tools\DevTools\Include.

  7. In the Show directories for box, click Executable files.

  8. Enter the path for SQL Server development binary executable files, typically C:\Program Files\Microsoft SQL Server\80\Tools\Binn.

You must change the executable directories list so Visual C++ will correctly locate the nsqlprep executable file.

The following illustration shows adding the path for header files to the Visual C++ include file path list.

As you create each ESQL/C source file, you must indicate the preprocessor steps necessary to generate the appropriate C source for compilation. Depending on the version of Visual C++, use the Build menu or the Project menu to locate the compilation settings for the project.

Compilation settings can be set at the source-file level, and the custom build steps for your ESQL/C source files are set at this level as well.

To add custom build steps for an ESQL/C source file

  1. On either the Project menu (Visual C++ 5.0) or the Build menu (Visual C++ 4.x), click Settings.

  2. Click the ESQL/C source file in the project's file list. In Visual C++ 5.0 a single instance of the file appears in the project's list. You can click All configurations in the Settings for box to set custom build commands for both debug and release versions of your project. In Visual C++ 4.x, you can expand the file list and select each occurrence of the ESQL/C source file to set the custom build commands for all project configurations.

  3. Click the Custom Build tab.

  4. In the Build commands box, enter the nsqlprep command. You can use the $(InputName) macro to specify the file.

  5. In the Output file(s) box, specify the name of the output file. The output file is a C source file. You can use the $(InputName) macro to specify the file.

The illustration below shows custom build settings for an ESQL/C source file.

After you've successfully preprocessed the ESQL/C source files, you can add the generated C source to your project.