Search code examples
c++builderdbexpress

how can I check if a tsqlconnection is open?


after an unsuccesfull login:

mytsqlconnection->Open();
if(mytsqlconnection->ConnectionState == csStateOpen)
{
 ...
}

the "if" returns true. How can I check if the connection is really open? Do I have to execute a query and catch the exception? Thanks in advance.

Francesco


Solution

  • It was a matter of driver. I used the dbexpora.dll that came with cppbuilder6 (right-click on dbexpora.dll give no info about version). I change driver and everything works fine: Open() raise the exception, ConnectionState is set as expected. Thankyou.

    Francesco