March 28, 2024, 01:27:17 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Cdatabase Class question

Started by Haim, April 02, 2007, 02:08:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Haim

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

Bruce Peaslee

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.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

Haim

Thanks for your reply,
I will use my own variable to track this, and keep looking for other ways as well.

Haim

Ionic Wind Support Team

Just check the m_hDBC member variable.

if mydatabase.m_hDBC != NULL
{
    //still connected.
}
Ionic Wind Support Team

Haim

Thanks for your response.
I know how tired you must be.
Get some rest.

Haim

Bruce Peaslee

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.
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles