IonicWind Software

Aurora Compiler => Database => Topic started by: Haim on April 02, 2007, 02:08:23 AM

Title: Cdatabase Class question
Post by: Haim on April 02, 2007, 02:08:23 AM
Hi,
I need to know if a specific CDataBase instance is still connected.
Does CDataBase provide this info, or should I maintain my own variable to track this status?
How can I be "told"  that a CDatabase is no longer connected?

Thanks for any yhelp,
Haim
Title: Re: Cdatabase Class question
Post by: Bruce Peaslee on April 02, 2007, 09:17:02 AM
I gave it a quick look and could not find a way.

I normally use a global variable to tell me when files are open (or db connected in this case) to allow changes in menu items, warnings about saving when exiting, etc.
Title: Re: Cdatabase Class question
Post by: Haim on April 02, 2007, 10:45:50 AM
Thanks for your reply,
I will use my own variable to track this, and keep looking for other ways as well.

Haim
Title: Re: Cdatabase Class question
Post by: Ionic Wind Support Team on April 03, 2007, 11:52:54 PM
Just check the m_hDBC member variable.

if mydatabase.m_hDBC != NULL
{
    //still connected.
}
Title: Re: Cdatabase Class question
Post by: Haim on April 04, 2007, 03:50:39 AM
Thanks for your response.
I know how tired you must be.
Get some rest.

Haim
Title: Re: Cdatabase Class question
Post by: Bruce Peaslee on May 10, 2007, 11:13:08 AM
Quote from: Paul Turley on April 03, 2007, 11:52:54 PM
Just check the m_hDBC member variable.

if mydatabase.m_hDBC != NULL
{
    //still connected.
}

If mydatabase.Connect() fails, m_hDBC is not null, so mydatabase.Disconnect() will crash.