Skip Headers

Oracle® Objects for OLE C++ Class Library Developer's Guide
10g Release 1 (10.1)

Part Number B10119-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

IsOpen Method

Applies To

OAdvise, OClient, OBinder, OConnection, OConnectionCollection, ODatabase, ODatabaseCollection, ODynaset, ODynasetMark, OField, OFieldCollection, OParameter, OParameterCollection, OSession, OSessionCollection, OAQ, OAQAgent, OAQMsg, OBfile, OBlob, OClob, OCollection, OException, OMDAttribute, OMetaData, OObject, ORef, OServer, OSnapshotID

Description

This method returns TRUE if the object is open.

Usage

virtual oboolean IsOpen(void) const

Remarks

See Close for a discussion of what it means for an object to be open or closed.

The most common use for IsOpen is to check an object after construction or after it has been returned from a routine. Closed objects indicate that there was some problem opening the object.

Return Value

TRUE if the object is open; FALSE otherwise.

Example

An example demonstrating when to use IsOpen:

// we construct and incorrectly open a database

ODatabase odb("p:ntserver", "user", "wrongpassword");

if (!odb.IsOpen())

{ // the database wasn't opened

// error processing

}

else

{ // the database is open

// use it

}