Modifying the Account Component to Use the ODBC Resource Dispenser

In this section, you enhance the Account component by adding a database connection. You revise the Post method to access a database using ActiveX Data Objects (ADO) to obtain the appropriate account information. This demonstrates using a resource dispenser ¾ in this case, the ODBC resource dispenser, which enables connections to be pooled for efficiency. You will also add a new class module, CreateTable, to the Account project.

To modify the Account component

  1. Open the \MTx\Samples\Account.VB\Step2\Account.vbp project.

    Click here to see the modified Account component

  2. Build the component as a DLL and save it as \MTx\Samples\Account.VB\Step2\VBAcct.dll.

By adding a new class module, you have added a new COM component to this DLL. Therefore, you will need to delete the Account component in the Microsoft Transaction Server Explorer and then install the Account and the MoveMoney components.

To reinstall your components

  1. Remove the Account component.

    How?

  2. Add the new components.

    How?

    Use the DLL you created in \MTx\Samples\Account.VB\Step2\VBAcct.dll.

You can now run the new component by using the Bank client. You should see a response Credit, balance is $ 1. (VB).

See Also

Creating the Account Component, Application Design Notes: Resource Usage, Programming Concepts, Creating a Simple ActiveX Component


© 1997 Microsoft Corporation. All rights reserved.