Contents Index  Microsoft Visual Basic Quick Start Glossary

ASA Getting Started
   Microsoft Visual Basic Quick Start

Tutorial: Developing a Visual Basic application


This brief tutorial is based on Visual Basic 6.0. The complete application can be found in the Visual Basic project Samples\ASA\VBStarter\ASAStarter.vbp.

Visual Basic provides several data access technologies. In this tutorial, we use the Microsoft ADO Data Control with the Adaptive Server Anywhere OLE DB provider to access the Adaptive Server Anywhere sample database from Visual Basic.

To develop a database application with Visual Basic

  1. Start Visual Basic, choosing a Standard Executable project.

  2. Add the Microsoft ADO Data Control 6.0 to your tool palette:

  3. Add the ADO Data Control to the form, as follows:

    The Visual Basic form with an ADO Data Control added.
  4. Configure the ADO Data Control:

    Property Value
    ConnectionString Provider=ASAPROV;DSN=ASA 9.0 Sample
    CursorLocation 2 - asUseServer
    CursorType 1 - adOpenKeyset
    RecordSource SELECT * FROM EMPLOYEE

    The ConnectionString uses the Adaptive Server Anywhere OLE DB Provider (ASAProv) to connect to the ASA 9.0 Sample data source. The cursor settings take advantage of Adaptive Server Anywhere cursors rather than using the client-side cursors.

  5. Add two text boxes to the form, as follows:

    The Visual Basic form with text controls added.
  6. Bind the text boxes to the ADO Data Control:

  7. Save the project.

  8. Run the sample:

    You have now created a simple Visual Basic application that works with Adaptive Server Anywhere.


Contents Index  Microsoft Visual Basic Quick Start Glossary