Using Microsoft Transaction Server with Oracle8i 

A68065-01

 
Library
 
Product
 
Contents
 
Index
 

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. 
  1. Back up the ROOTDRIVE:\PROGRAM FILES\MTS\ SAMPLES\PACKAGES\VCACCT.DLL file on your Windows NT computer to a different location. 
  2. 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, your directory paths will differ. See your operating system-specific documentation for additional information. On Windows NT, for example, see your Getting Started guide. 


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 Net8 alias 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 Oracle8i database created during installation. See the following section "Ensuring the Oracle8i Database Includes the Proper Tables" to ensure that your Oracle8i database includes this schema.

Ensuring the Oracle8i Database Includes the Proper Tables

If the default Oracle8i database is not being used or your Oracle8i 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 Oracle8i database includes the proper tables:

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


  2. If You Create Your Oracle8i Database Through These Methods... Then...
    • Through the Typical option of Oracle Universal Installer 
    • 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 Getting Started 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 Oracle8i 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 Oracle8i database does not include the proper tables. Perform steps 2 through 7 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.
     
  1. Start SQL*Plus:
  2. C:\> SQLPLUS
  3. Connect with the SYSTEM user name:
  4. ENTER USER-NAME: SYSTEM/PASSWORD@NET_SERVICE_NAME
where PASSWORD is MANAGER after Oracle8i database installation, unless you changed it, and NET_SERVICE_NAME is the Net8 network connection to the Oracle8i database.
  1. Create the user MTSDEMOUSR:
  2. SQL> CREATE USER MTSDEMOUSR IDENTIFIED BY MTSDEMOUSR;
This creates the user MTSDEMOUSR, which is used to run the Microsoft sample application.
  1. Assign the following roles to user MTSDEMOUSR:
  2. SQL> GRANT CONNECT, RESOURCE TO MTSDEMOUSR;
  3. Connect with user MTSDEMOUSR:
  4. SQL> CONNECT MTSDEMOUSR/MTSDEMOUSR@NET_SERVICE_NAME
  5. Execute the following SQL script:
  6. 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 Oracle8i 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 .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. 
  1. Enter the following at the MS-DOS command prompt: 
  2. 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.  
    2. Choose Start > Settings > Control Panel.
    3. Double-click Add/Remove Programs.
    4. The Add/Remove Programs Properties dialog box appears.
    5. Select Windows NT 4.0 Option Pack and click Add/Remove.
    6. The setup takes several seconds to initialize. When complete, the Microsoft Windows NT 4.0 Option Pack Setup dialog box appears.
    7. Click Next.
    8. Click Add/Remove.
    9. Scroll through the list until you find Transaction Server.
    10. Double-click Transaction Server.
    11. 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.
    12. Click OK.
    13. Click Next on the Microsoft Windows NT 4.0 Option Pack Setup dialog box.
    14. Installation takes several seconds.
    15. Exit the Add/Remove Programs Properties dialog box.
    16. Exit the Control Panel.
    17. Go to step 2.
  1. Open the project ACCOUNT.DSP located under ORACLE_BASE\ORACLE_HOME\ORAMTS\SAMPLES\ACCOUNT.VC using Microsoft Developer Studio.

  2.  
  3. Build VCACCT.DLL.

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

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

  8.  
  9. 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.
  1. Click the Visual C++ radio button of the Language field.

  2.  
  3. Click the Account or the MoveMoney radio boxes under the Component field.

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

  6.  
  7. Click Submit.

  8.  
  9. Start SQL*Plus
  10. C:\> SQLPLUS
  11. Connect with the user name SCOTT and password TIGER (unless you changed it):
  12. ENTER USER-NAME: SCOTT/TIGER
  13. Verify the success of the operation:
  14. 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.



 
Prev
 
Next
 
Oracle 
Copyright © 1999 Oracle Corporation. 
All Rights Reserved.
 
Library
 
Product
 
Contents
 
Index