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

ConnectSession Method Example

This example demonstrates the use of ConnectSession and CreateNamedSession to allow an application to use a session it previously created, but did not save. Copy this code into the definition section of a form. Then press F5.

Sub Form_Load ()

'Declare variables

Dim dfltsess As OraSession

Dim OraSession As OraSession

'Create the default OraSession Object.

Set dfltsess = CreateObject("OracleInProcServer.XOraSession")

'Try to connect to "ExampleSession". If it does not exist

'an error is generated.

On Error GoTo SetName

Set OraSession = dfltsess.ConnectSession("ExampleSession")

On Error GoTo 0

'You can specify other processing here, such as creating a

' database and/or dynaset.

Exit Sub

SetName:

'The session named "ExampleSession" was not found, so create it.

Set OraSession = dfltsess.Client.CreateSession("ExampleSession")

Resume Next

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