Oracle Objects for OLE
Release 9.2

Part Number A95895-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback

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

The following variables are defined globally in EMP_QT.BAS:

Global OraSession As Object

Global OraDatabase As Object

Global EmpDynaset As Object


 
Oracle
Copyright © 1994, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents

Master Index

Feedback