Visual Basic .NET application compile and link options

This topic describes the various options available when compiling and linking Visual Basic .NET applications.

The following compile and link options are available for building Visual Basic .NET applications on Windows with the Microsoft Visual Basic .NET compiler, as demonstrated in the bldapp.bat batch file.

Note: The .NET Framework Version 1.1 is supported only with the .NET Provider Version 9.5 and earlier.

Compile and link options for stand-alone VB .NET applications using bldapp

Compile and link options for stand-alone VB .NET applications:
%BLDCOMP%
Variable for the compiler. The default is vbc, the Microsoft Visual Basic .NET compiler.
/r:"%DB2PATH%"\bin\%VERSION%\IBM.Data.DB2®.dll
Reference the Db2 dynamic link library for the .NET framework version that you are using.
%DB2PATH%
The %DB2PATH% variable represents root path of the Db2® product installation. The %DB2PATH% variable is not present on IBM Data Server Driver for ODBC and CLI or Data Server Driver Package installation.
When using IBM® IBM Data Server Driver for ODBC and CLI or Data Server Driver Package replace %DB2PATH% with a path where driver product is installed.
%VERSION%
There are several supported versions of the .NET framework for applications. Db2 has a dynamic link library for each. For .NET Framework Version 2.0, 3.0, and 3.5, %VERSION% points to the netf20\ sub-directory.

Compile and link options for the loosely-coupled sample program, LCTrans using bldapp:

%BLDCOMP%
Variable for the compiler. The default is vbc, the Microsoft Visual Basic .NET compiler.
/out:RootCOM.dll
Output the RootCOM dynamic link library, used by the LCTrans application, from the RootCOM.vb source file,
/out:SubCOM.dll
Output the SubCOM dynamic link library, used by the LCTrans application, from the SubCOM.vb source file,
/target:library %1.cs
Create the dynamic link library from the input source file (RootCOM.vb or SubCOM.vb).
/r:System.EnterpriseServices.dll
Reference the Microsoft Windows System EnterpriseServices data link library.
/r:"%DB2PATH%"\bin\%VERSION%\IBM.Data.DB2.dll
Reference the Db2 dynamic link library for the .NET framework version you are using.
%DB2PATH%
The %DB2PATH% variable represents root path of the Db2 product installation. The %DB2PATH% variable is not present on IBM Data Server Driver for ODBC and CLI or Data Server Driver Package installation.
When using IBM IBM Data Server Driver for ODBC and CLI or Data Server Driver Package replace %DB2PATH% with a path where driver product is installed.
%VERSION%
There are several supported versions of the .NET framework for applications. Db2 has a dynamic link library for each. For .NET Framework Version 2.0 and 3.0, %VERSION% points to the netf20\ sub-directory.
/r:System.Data.dll
Reference the Microsoft Windows System Data dynamic link library.
/r:System.dll
Reference the Microsoft Windows System dynamic link library.
/r:System.Xml.dll
Reference the Microsoft Windows System XML dynamic link library (for SubCOM.vb).
/r:SubCOM.dll
Reference the SubCOM dynamic link library (for RootCOM.vb and LCTrans.vb).
/r:RootCOM.dll
Reference the RootCOM dynamic link library (for LCTrans.vb).

Refer to your compiler documentation for additional compiler options.