inkle c wrote:
>
> Well, this is where the problem comes because PgDatabase() is a
> protected constructor, myclass doesn't inherit from PgDatabase. In
> simple words:
> ==============================================
> class myclass {
> public:
> myclass();
> private:
> PgDatabase db;
> }
>
> myclass::myclass():db(NULL){
> some-other-stuff-goes-here
> };
> ===============================================
> the above codes causes me trouble as I described
> below, any ideas how to fix it? I also tried
> PgDatabase db as a global variable and init it to
> be NULL, but this causes the same problem.
As far as I remember if you send NULL, you are saying that
the string that PgDatabase uses is empty rather than being say
"dbname=test", and that it should try to connect ?using defaults?,
whereas if you just db(), you are saying, this instance isn't
initialised, create it, but don't connect. I'm afraid I can't
UTSL at the moment...
Cheers,
Patrick