Using Microsoft Transaction Server with Oracle8
Release 8.1.6 for Windows NT

Part Number A73029-01

Library

Product

Contents

Index

Go to previous page Go to next page

4
Using the Microsoft Application Demo

This chapter describes how to use the sample Microsoft Component Object Model (COM)-based application demo that is integrated with Microsoft Transaction Server.

Specific topics discussed are:

Using OCI with the Microsoft Application Demo

You can use the Oracle Call Interface (OCI) with the sample banking application demo that Microsoft provides with Microsoft Transaction Server. In most cases, OCI is automatically integrated with the Microsoft application demo. Review the table below to determine if OCI and the Microsoft application demo are integrated in your environment, and what you can do if they have not been integrated.

If...  Then... 

Microsoft Transaction Server is already installed when you install Oracle Services for Microsoft Transaction Server 

Oracle Universal Installer automatically backs up and substitutes several Visual C++ files in the banking demo with files that integrate the OCI.DLL and ORAMTS.DLL files. This enables you to use OCI with the banking demo.  

Microsoft Transaction Server is not installed when you install Oracle Services for Microsoft Transaction Server

 

Perform the following procedures:

  1. Install Microsoft Transaction Server.

  2. Back up the ROOTDRIVE:\PROGRAM FILES\MTS\ SAMPLES\PACKAGES\VCACCT.DLL file on your Windows NT computer to a different location.

  3. Copy the VCACCT.DLL file in ORACLE_BASE\ORACLE_HOME\ORAMTS\ SAMPLES\ACCOUNT.VC\RELEASE to the Windows NT directory listed in step 2.

 


Note:

The directory path examples in this guide follow Optimal Flexible Architecture (OFA) guidelines (for example, ORACLE_BASE\ORACLE_HOME\ORAMTS\TRACE). If you specified non-OFA compliant directories during installation or installed a release 8.0.6 database, your directory paths will differ. See the following documentation for additional information:

 

Microsoft Application Demo Overview

The Microsoft application demo is installed under ORACLE_BASE\ORACLE_HOME\ORAMTS\ SAMPLES\ACCOUNT.VC and is an OCI implementation of the Visual C++ Sample Bank package that ships with Microsoft Transaction Server. The demo component uses the user account SCOTT and password TIGER to connect to a database whose net service name is MTSDEMO. You can change this information in the ORAMISC.H file. The demo also uses two tables:

These tables are part of the schema of user SCOTT in the default Oracle8 database created during installation. See the following section "Ensuring the Oracle8 Database Includes the Proper Tables" to ensure that your Oracle8 database includes this schema.

Ensuring the Oracle8 Database Includes the Proper Tables

If the default Oracle8 database is not being used or your Oracle8 database does not include the user SCOTT, the tables required to run the sample banking Microsoft application demo can be created in the relevant user's schema.

To ensure the Oracle8 database includes the proper tables:

  1. Review the following table to determine if your Oracle8 database includes the proper tables:

    If You Create Your Oracle8 Database Through These Methods...  Then... 
    • Through the Typical or Minimal installation type of the Oracle8i Enterprise Edition or Oracle8i database type

    • Through the Typical option of the Oracle Database Configuration Assistant where you select to copy existing database files from the CD

    • Manually using the database creation script available on your Oracle 8.1 CD-ROM (On Windows NT, this script is named BUILDALL.SQL and is described in your Oracle8i Administrator's Guide for Windows NT guide.)

    • Manually using your own SQL script, and then explicitly run the SCOTT.SQL and ORAMTS.SQL scripts in that order against the database1

     

    Your Oracle8 database includes the proper tables. Go to section "Running the Microsoft Application Demo" to run the sample demo. 

    • Through the Custom option of the Oracle Database Configuration Assistant

    • Through the Typical option of the Oracle Database Configuration Assistant where you select to create new database files

    • Manually using your own SQL script, and do not run ORAMTS.SQL against the database

    • Using the CREATE DATABASE syntax in SQL*Plus line mode

    • In any available method on Solaris or any other operating system.

     

    Your Oracle8 database does not include the proper tables. Perform steps 1 through 6 in this section before proceeding to section "Running the Microsoft Application Demo" to run the sample demo. 

    1 If you run ORAMTS.SQL before running SCOTT.SQL or do not run SCOTT.SQL at all, you receive numerous error messages when running ORAMTS.SQL. These messages can be ignored. The product functions properly, but the sample application demo described in this chapter will not work.

If your Oracle8 database does not include the proper tables, you must create them manually.

To manually create the proper tables:

  1. Start SQL*Plus:

    C:\> SQLPLUS
    
  2. Connect with the SYSTEM user name:

    ENTER USER-NAME: SYSTEM/PASSWORD@NET_SERVICE_NAME
    

    where PASSWORD is MANAGER after Oracle8 database installation, unless you changed it, and NET_SERVICE_NAME is the net service name that connects to the Oracle8 database.

  3. Create the user MTSDEMOUSR:

    SQL> CREATE USER MTSDEMOUSR IDENTIFIED BY MTSDEMOUSR; 
    

    This creates the user MTSDEMOUSR, which is used to run the Microsoft sample application.

  4. Assign the following roles to user MTSDEMOUSR:

    SQL> GRANT CONNECT, RESOURCE TO MTSDEMOUSR; 
    
  5. Connect with user MTSDEMOUSR:

    SQL> CONNECT MTSDEMOUSR/MTSDEMOUSR@NET_SERVICE_NAME
    
  6. Execute the following SQL script:

    SQL> @\ORACLE_BASE\ORACLE_HOME\ORAMTS\SAMPLES\ACCOUNT.VC\OMTSSAMP.SQL
    

    This creates the ACCOUNT and RECEIPT tables in the schema of user MTSDEMOUSR.


    Note:

    The Oracle Service for MTS (with user MTSSYS) and the sample application components (with user MTSDEMOUSR) use separate user accounts to connect to the Oracle8 database. 


Running the Microsoft Application Demo

To run the Microsoft application demo:


Note:

The sample project was created using Visual C++ 5.0. To build the project using Visual C++ 6.0, the Microsoft .IDL file must be processed with the new version of the MIDL compiler included with Visual C++ 6.0:

  1. Go to the directory ORACLE_BASE\ORACLE_HOME\ORAMTS\SAMPLES\ACCOUNT.VC.

  2. Enter the following at the MS-DOS command prompt:

    
    
    MIDL ACCOUNT.IDL
    
    

When opening a Visual C++ 5.0 project, Visual C++ 6.0 automatically updates it to the new version. 


  1. Ensure that you have installed the Sample Bank Client application shipped with Microsoft Transaction Server. The sample component DLLs are typically installed under ROOTDRIVE:\PROGRAM FILES\MTS\SAMPLES\ PACKAGES. You can also verify installation through the Control Panel:

    1. Choose Start > Settings > Control Panel.

    2. Double-click Add/Remove Programs.

      The Add/Remove Programs Properties dialog box appears.

    3. Select Windows NT 4.0 Option Pack and click Add/Remove.

      The setup takes several seconds to initialize. When complete, the Microsoft Windows NT 4.0 Option Pack Setup dialog box appears.

    4. Click Next.

    5. Click Add/Remove.

    6. Scroll through the list until you find Transaction Server.

    7. Double-click Transaction Server.

    8. Ensure that the Transaction Server Development subcomponent check box is selected; this indicates that the demo is installed. If this subcomponent is not selected, then select it and follow steps i through m. Otherwise, go to step 2.

    9. Click OK.

    10. Click Next on the Microsoft Windows NT 4.0 Option Pack Setup dialog box.

      Installation takes several seconds.

    11. Exit the Add/Remove Programs Properties dialog box.

    12. Exit the Control Panel.

    13. Go to step 2.

  2. Open the project ACCOUNT.DSP located under ORACLE_BASE\ORACLE_HOME\ORAMTS\SAMPLES\ACCOUNT.VC using Microsoft Developer Studio.

  3. Build VCACCT.DLL.

  4. Back up the file VCACCT.DLL installed under ROOTDRIVE:\PROGRAM FILES\MTS\SAMPLES\PACKAGES.

  5. Overwrite VCACCT.DLL with the one you built in step 3.

  6. Choose Start > Programs > Windows NT 4.0 Option Pack > Microsoft Transaction Server > Bank Client.

    This starts the Sample Visual Basic Bank application and runs VBBANK.EXE to test the component.

  7. Click the Visual C++ radio button of the Language field.

  8. Click the Account or the MoveMoney radio boxes under the Component field.

  9. Enter the account number(s) and the amount for the operation.

  10. Click Submit.

  11. Start SQL*Plus

    C:\> SQLPLUS
    
  12. Connect with the user name SCOTT and password TIGER (unless you changed it):

    ENTER USER-NAME: SCOTT/TIGER
    
  13. Verify the success of the operation:

    	SQL> SELECT * FROM ACCOUNT; 
    	SQL> SELECT * FROM RECEIPT; 
    

Using Oracle's ODBC Driver with the Microsoft Application Demo

You can use Oracle's ODBC release 8.1 driver with the Microsoft sample application. See section "Using Oracle's ODBC Driver" for instructions on integrating Oracle's ODBC with the sample application.


Go to previous page Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index