3 Replies Latest reply: Jan 11, 2012 5:51 AM by fscherie-Oracle RSS

    Dump app when invoke createConnection (OCCI ver 11.2.0.1.0 VC2005 64bits)

    906871
      Hi:

      I have a problem with createConnection, when this method is called my application is crashed.

      This is my code:

      string g_user = "myuser";
      string g_passwd = "mypwd";
      string g_db = "SERVICES_BT";

      int ORAOpenSession(int nIndex, char *pError, int &nError)
      {
      int result = 0;
      int nsize = 0;

      if (pError == NULL || nIndex < 0)
      return -1;

      nsize = sprintf_s(pError, nError, "ORAOpenSession");

      g_penv = Environment::createEnvironment(Environment::DEFAULT);

      nError = sprintf_s(pError, nError, "ORAOpenSession:Environment::createEnvironment 0x%x", g_penv);

      try {

      //
      // this line generates the error
      //
      g_pcon = g_penv->createConnection(g_user, g_passwd, g_db);
      nError = sprintf_s(pError, nError, "g_penv->createConnection = 0x%x\n", g_pcon);

      } catch (SQLException &sqlExcp) {
      nError = sprintf_s(pError, nError, "Final Construct >> Error SQLException (index:%d)(counter:%d)(msg:%s : %s)",
      nIndex, sqlExcp.getErrorCode(), sqlExcp.what());
      result = -1;
      } catch (exception &excp) {
      nError = sprintf_s(pError, nError, "Final Construct >> Error Exception (index:%d)(msg:%s)",
      nIndex, excp.what());
      result = -1;
      }

      nError = sprintf_s(pError, nError, "ORAOpenSession : result:%d", result);

      return result;
      }

      and the content of "tnsnames.oRA" is:

      SERVICE_BT =
      (DESCRIPTION =
      (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = myhost.domain.org)(PORT = 1527))
      )
      (CONNECT_DATA =
      (SERVICE_NAME = SERVICE_BT)
      )
      )

      Help me please....

      Greetings

      Bryan