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
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.
Thanks for your reply,
I will use my own variable to track this, and keep looking for other ways as well.
Haim
Just check the m_hDBC member variable.
if mydatabase.m_hDBC != NULL
{
//still connected.
}
Thanks for your response.
I know how tired you must be.
Get some rest.
Haim
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.