Oracle® Objects for OLE C++ Class Library Developer's Guide 10g Release 2 (10.2) Part Number B14308-01 |
|
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
}