Open inheritance means everyone knows that Derived is derived from Base.
Protected inheritance means that only Derived, Derived friends, and classes derived from Derived know that Derived is derived from Base. *
Private inheritance means that only Derived and Derived friends know that Derived is derived from Base.
Since you used private inheritance, your main () function has no idea about generating from the database, therefore it cannot assign a pointer.
Private inheritance is typically used to fulfill the is-implement-in-terms-of relationship. One example might be that Base provides a virtual function that you need to override, and therefore it should be inherited, but you don't want clients to know that you have these inheritance relationships.
* also: how much wood would be a wooden patron ...
Kaz dragon
source share