Oracle Objects for OLE
Release 8.1.7

Part Number A85257-01

Library

Product

Contents

Getting Started: Steps to Accessing Oracle Data

See Also
Quick Tour
Employee Form

Before we can manipulate server data, our Visual Basic code must first complete the following steps, typically in the Form_Load() procedure:

  1. Start the Oracle in Process Server.

See
Starting the Oracle In Process Server

2. Connect to the Oracle database.

See
Connecting to the Oracle Database

3. Create a global OraDynaset object to manipulate data.

See
Creating a Dynaset

4. Refresh the Employee form with dynaset data.

See
Refreshing Screen Data

In our example employee application, the Form_Load() procedure creates the OIP server, connects to the database, creates a global dynaset, and calls the function EmpRefresh to display the field values on the Employee form. The code for Form_Load() looks like:

Private Sub Form_Load()

'OraSession and OraDatabase are global

Set OraSession = CreateObject("OracleInProcServer.XOraSession")

Set OraDatabase = OraSession.OpenDatabase("Exampledb", "scott/tiger", 0&)

Set EmpDynaset = OraDatabase.CreateDynaset(
"select * from emp", 0&)

Call EmpRefresh

End Sub

T
he following variables are defined globally in EMP_QT.BAS:

Global OraSession As Object

Global OraDatabase As Object

Global EmpDynaset As Object


 
Oracle
Copyright copy; 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents