Throws an exception if this object is not open OdDb::kForRead.
This function should be used only inside member functions that do not modify this object. It should be the first function called by these functions.