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

Find Methods Example

This example demonstrates the use of the FindFirst, FindNext, FindPrevious methods. Copy and paste this code into the definition section of a form. Then press F5.

Sub Form_Load ()

Dim OraSession As OraSession

Dim OraDatabase As OraDatabase

Dim OraDynaset As OraDynaset

Dim OraFields As OraFields

Dim FindClause As String

Set OraSession = CreateObject("OracleInProcServer.XOraSession")

Set OraDatabase = OraSession.OpenDatabase("ExampleDb", "SCOTT/TIGER", 0&)

Set OraDynaset = OraDatabase.CreateDynaset("select * from emp where empno >= 7654 and empno <= 7844 ", ORADYN_NO_BLANKSTRIP)

Set OraFields = OraDynaset.Fields

OraDynaset.MoveFirst

'FindClause for job as MANAGER

FindClause = "job LIKE '%GER'"

OraDynaset.FindFirst FindClause

'NoMatch property set to true , if no rows found

If OraDynaset.NoMatch Then

MsgBox "Couldn't find rows "

else

MsgBox OraFields("ename").Value ' Should display BLAKE

OraDynaset.FindNext FindClause

MsgBox OraFields("ename").Value ' Should display CLARK

OraDynaset.FindPrevious FindClause

MsgBox OraFields("ename").Value ' Should display BLAKE

endif

End Sub


 
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