
APAR= II09863
CA400WINOPT ODBC RUNNING 16 BIT ODBC APPLICATIONS

CA400WINOPT ODBC RUNNING 16 BIT ODBC APPLICATIONS

Date Last Modified 06/18/97

To connect and run a 16 bit application to the AS400
via ODBC requires a thunk layer to convert the 16 bit
ODBC api calls to 32 bit ODBC api calls.  We currently
offer two methods to accomplish this.  The method
you must use depends on the PC operating system (Windows
95 or NT) and the type of connectivity.

NOTE THAT MANY OEM SOFTWARE VENDORS DO NOT SUPPORT
THEIR 16 BIT APPLICATIONS RUNNING UNDER WINDOWS 95.
Furthermore, many of these applications use
programming techniques that do not work with the
ODBC thunk.  See II09468 for a list of common problems.

IF YOU ARE USING:
  -WINDOWS 95 OVER TCP/IP or IPX
  -WINDOWS NT 4.0 OVER ANY PROTOCOL
  You should use the ODBC thunk dll included with
  the ODBC driver manager.  DO NOT USE THE SNA THUNK
  INSTRUCTIONS BELOW. Simply configure a 32 bit
  ODBC driver data source for the AS/400 and add
  the client access shared directory to the path
  statement of your autoexec.bat file.
  If you installed Client Access into the default
  directory the path would be:
  C: PROGRA 1 IBM CLIENT 1 SHARED where the blank
  should be a tilde.


IF YOU ARE RUNNING WINDOWS 95 and ARE CONNECTED
VIA SNA (NETSOFT, SNA SERVER, NOVELL SAA, or
other OEM WINAPPC router):
You must use the Client Access for windows 3.1
16 bit ODBC driver and our 16 bit communication
API thunk.  The remainder of this document
describes the steps required to install this support.

In order to run 16-bit ODBC applications over SNA, you must
use the Client Access for windows 3.1 16-bit ODBC driver and
our 16 bit API thunk.  You first must enable 16-bit APPC
applications.  The information on how to do this is in the
on-line User's Guide, go to the User's Guide's Index tab and
double click on "16-bit applications"  For your convenience,
this information has been duplicated here.

******* start excerpt from User's Guide *******************
Enabling 16-Bit Applications for Client Access

     Even though Client Access for Windows 3.1 is not
supported in the 32-bit Client Access environment, you can
still run applications you purchased or created to use with
the Windows 3.1 client.  This procedure describes what you
need to do to enable the 16-bit applications to work with
Client Access.  Using this setup will enable your 16-bit
applications to coexist with the 32-bit version of Client
Access.


Important:

     In order to use 16-bit applications when you have
completed the steps in this procedure, you need to be
connected to the AS/400 system using APPC communications.
     This support will not allow you to use 16-bit
applications through TCP/IP communications.
     After you do the steps in this procedure, you will not be
able to run Client Access for Windows 3.1 with the
communications stack you were previously using with Client
Access for Windows 3.1.  Also, if you have dual-boot set up to
so that you can run Windows 3.1 on your PC, you will not be
able to run Client Access for Windows 3.1 when running Windows
3.1.  If for some reason you need to use the Windows 3.1
client functions again, you will need to undo Step 2 and Step
3 (rename the .SAV files and remove the directory entries
added to the PATH statement).


Step 1

Copy all of the Client Access for Windows 3.1 DLL files from
the AS/400 system to your PC.  If Client Access for Windows
3.1 is installed on your PC, skip this part of the procedure
and start with Step 2.

1  Set up a network drive for the QPWXCWN directory on the
   AS/400 system.
   You can use any communications connection type to perform
   this part of the procedure.
2  Open a DOS session.
3  Change the DOS prompt to C: .
4  Type MD CAWIN to create a CAWIN directory on your PC.
5  Type CD  CAWIN to change the DOS prompt to the CAWIN
   directory.
6  Type the following commands at the DOS prompt, where d is
   the network drive you mapped to QPWXCWN on the AS/400
   system:

      COPY d:EHN*.DLL
      COPY d:PCSMOND.DLL

Step 2
Rename the following files that were copied to the CAWIN
directory on your PC in Step 1.  You can use the DOS rename
command or you can click the right mouse button on the file
name in the Windows 95 Explorer and select Rename.

      File              Rename to
      EHNAPPC.DLL       EHNAPPC.SAV
      EHNEC.DLL         EHNEC.SAV
      EHNRTRW.DLL       EHNRTRW.SAV
      EHNCLT1.DLL       EHNCLT1.SAV


Step 3
Add the following directories to the PATH statement in your
AUTOEXEC.BAT file:

C: Progra 1 IBM Client 1 Shared;C: CAWIN;
  again, note that the spaces after Progra and Client
  should be tildes.

Step 4
Open the Client Access program group, (Start³Programs³Client
Access).  Double-click on the Client Access Properties
shortcut.  Click on the "Other" tab.  Check the "Enable 16-bit
Client Access support" checkbox, then close the properties
program.

Step 5
Shutdown and restart Windows 95.  You should now be able to
use the AS/400 Connections object in the Client Access folder
to start a connection to the AS/400 system and run the 16-bit
applications.  Do not use the Client Access for Windows 3.1
AS/400 Connection icon to start the AS/400 connection.

In order to use this setup, you must be connected to the
AS/400 system using a 32-bit SNA stack, for example, one of
the following:

      NetSoft NS/Router 2.00 and above
      IBM Personal Communications
      Microsoft SNA 2.11

*********** end excerpt from user's guide *******************

In addition to the files listed above you will need to copy:

      from                         to
-------------------------------------------------------------
      QPWXCWN MRI2924 EHNODBC3.*   c: cawin MRI2924
      QPWXCWN CTL3DV2.DLL          c: windows system
      QPWXCWN ODBC.INF             c: cawin
      QPWXCWN CTL3D.DLL            c: windows system
      QPWXCWN ODBCINST.DLL         c: windows system
      QPWXCWN ODBCADM.EXE          c: windows
      QPWXCWN ODBCINST.HLP         c: windows

Start the 16-bit ODBC administrator (from a command prompt
or Explorer start C: WINDOWS ODBCADM.EXE).  Click on
"Drivers", then "Add".  You should now see the Add Driver
dialog and it is prompting for the location of the new ODBC
driver.  Type in c: cawin and click "OK".

Select the "Client Access/400" driver from the list
and click "OK" once more.

You have now installed the 16-bit driver.  In order to use any
16-bit ODBC applications you will also need to add data
sources using the 16 bit administrator and the Client
Access/400 ODBC driver.

NOTE:  The 16 bit ODBC driver will not be automatically
updated during service pack install.  If you would like
to enable automatic updates, use the Directory Update
program supplied with Client Access.
1) Click on the Directory Update icon
2) Select file new
   Description:  16 odbc update
   Source Path:  x: qpwxcwn  where x is a drive assigned
                             to the as/400
   Destination Path:  c: cawin where c: cawin is the
            directory used for 16 client access files.
   Update using:  Package files.
3) Click on the Details... button.
   Highlight EHNODBC.PKG from the "available column"
   and click add.  You should now have EHNODBC.PKG
   in the "Selected" column.
   Click OK until you are back to directory update.
4) Move the "start directory update" icon to your
   windows startup group to have this run at boot.





