Skip Headers
Oracle® Services for Microsoft Transaction Server Developer's Guide
10g Release 2 (10.2) for Microsoft Windows

Part Number B14320-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

4 Running the Microsoft Application Demo

This chapter describes how to use the sample Microsoft component object model (COM) application demo that is integrated with Microsoft Transaction Server.

This chapter contains these topics:

4.1 Configuring Oracle Call Interface 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. Determine if OCI and the Microsoft application demo are integrated, and what you can do if they have not been integrated.

If the Microsoft Transaction Server is already installed when you install OraMTS, then the Oracle Universal Installer automatically backs up and substitutes several Visual C++ files of the banking demo with files that integrate the oci.dll and oramts.dll files. This enables you to use OCI with the banking demo.

If the Microsoft Transaction Server is not installed when you install OraMTS, then do the following:

  1. Install Microsoft Transaction Server.

  2. Back up the ROOTDRIVE:\program files\mts\ samples\packages\vcacct.dll file to a different location.

  3. Copy the vcacct.dll file in ORACLE_BASE\ORACLE_HOME\oramts\samples\account.vc\release to the directory listed in Step 2.

4.1.1 Microsoft Application Demo Overview

The Microsoft application demo is installed in the ORACLE_BASE\ORACLE_HOME\oramts\samples\account.vc directory 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 account and receipt tables.

These tables are part of the user scott schema in the default Oracle Database created during installation.

See Also:

Unlocking the Sample Tables in SQL*Plus User's Guide and Reference for more information on unlocking the sample schemas

4.1.2 Ensuring the Database Includes the Proper Microsoft Application Demo Tables

If the default database is not being used, or the database does not include the user scott, create the tables required to run the sample banking Microsoft application demo in the relevant user's schema.

To ensure the database includes the proper tables, determine if the database includes the proper tables:

  • If you create the database automatically (using the General Purpose, Transaction Processing, or Data Warehouse database configuration type of Oracle Universal Installer or Database Configuration Assistant) or manually (using a custom SQL script, and then explicitly running the scott.sql script followed by the omtssamp.sql script), then the database includes the proper tables.

    Go to "Running the Microsoft Application Demo".

  • If you create the database by manually using a custom SQL script and do not run omtssamp.sql against the database, using the CREATE DATABASE syntax in SQL*Plus line mode, or in any available method on Solaris or any other operating system, then the database does not include the proper tables. Perform steps 0 through 6 in this section before proceeding to "Running the Microsoft Application Demo".

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

To manually create the proper tables:

  1. Start SQL*Plus:

    C:\> sqlplus /NOLOG
    
    
  2. Connect to the database:

    SQL> CONNECT username/password@net_service_name
    
    

    where net_service_name is the net service name that connects to the database. If you connect to the database with a username other than scott, you must change the username and password in oramisc.h and rebuild vcacct.dll.

  3. Create the user mtsdemousr:

    SQL> CREATE USER mtsdemousr IDENTIFIED BY mtsdemousr; 
    
    

    This creates the user mtsdemousr, which runs the Microsoft sample application.

  4. Assign the following roles to user mtsdemousr:

    SQL> GRANT CREATE SESSION,RESOURCE TO mtsdemousr;
    
    
  5. Connect with user mtsdemousr:

    SQL> CONNECT mtsdemousr/mtsdemousr@net_service_name
    
    
  6. Run the following SQL script:

    SQL> @ORACLE_BASE\ORACLE_HOME\oramts\samples\sql\omtssamp.sql
    
    

    This creates the account and receipt tables in the schema of user mtsdemousr.

4.1.3 Running the Microsoft Application Demo

This section describes how to run the Microsoft application demo:

  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.

  2. Open the project account.dsp in the ORACLE_BASE\ORACLE_HOME\oramts\SAMPLES\account.vc\Release directory 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. From the Start menu, choose Programs, then Windows Option Pack, then Microsoft Transaction Server, then 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 numbers and the amount for the operation.

  10. Click Submit.

  11. Start SQL*Plus:

    C:\> sqlplus /NOLOG
    
    
  12. Connect with the username scott and the password tiger (unless you changed it):

    SQL> CONNECT scott/tiger
    
    
  13. Verify the success of the operation:

    SQL> SELECT * FROM account; 
    SQL> SELECT * FROM receipt; 
    

4.2 Configuring Oracle ODBC Driver with the Microsoft Application Demo

You can use Oracle Open Database Connectivity (ODBC) Driver 10g release 1 (10.1) with the Microsoft sample application.

See Also:

"Programming with Microsoft Transaction Server and an Oracle Database" for instructions on integrating the Oracle ODBC Driver with the sample application

4.3 Configuring Oracle Provider for OLE DB with the Microsoft Application Demo

You can use Oracle Provider for OLE DB 10g release 1 (10.1) with the Microsoft sample application.

See Also:

Oracle Provider for OLE DB Developer's Guide for information about using Oracle Provider for OLE DB with Microsoft Transaction Server