Sample Programs

The source code and executable files for several sample programs that illustrate using the Microsoft® OLE DB Provider for AS/400 and VSAM are located in the \SDK\SAMPLES\SNAOLEDB subdirectory on the SNA Server CD-ROM. These files are also copied to your hard drive during SNA Client Binary installation when the SDK option is selected.

The file named SAMPLE.HCD located in the SNAOLEDB subdirectory contains two examples of a Host Column Description (HCD) file required to access host VSAM files. Please see documentation on the Host Column Description in this Appendix for more information. The SAMPLE.HCD file is described in this section as well.

Several executable sample programs with source code are provided with the OLE DB Provider for AS/400 and VSAM:

Before running these examples it is necessary to create a data file on the SNA host that will be used for demonstration purposes. After a suitable file is created on the host, it is necessary to run the SNA OLE DB Management Console snap-in application in order to configure the appropriate default settings for the SNA OLE DB Provider such as APPC mode, the character code set Identifier (CCSID) to be used when converting host data, and the Code Page to be used on the local PC.

If the data is on a mainframe host, it is also necessary to configure a data description (create a host column description file) using the SNA OLE DB Management snap-in. The host column description specifies the column description of the data file on the host and how the OLE DB provider should convert data from the host to the PC. Although an HCD file is unnecessary to access data files on the AS/400, a host column description can be specified that will override the default conversions.

The following sections discuss setting up and using each sample application in more detail.