0 Replies Latest reply on Oct 11, 2006 11:06 AM by 506350

    Cannot connect to DB from MFC application using OO4O

    506350
      Hi to all.
      I have the following problem
      I created a MFC application. I decided to use OO4O as a layer to connect to my Oracle database. The Oracle database is located on a remote server but has a network alias - "mydb_mysrv". The name exists in tnsnames.ora file and I connect to the DB from couple of applications.
      But I cannot connect to the database from my MFT app. The code is the following:

      ODatabase db;
      db.Open("mydb_mysrv", "scott", "tiger");
      if (db.IsOpen()) {
      printf("OK");
      // other code
      } else {
      printf("Failed to connect to the DB!");
      }

      The code always returns "Failed to connect to the DB!" and actually fails to connect.
      I can understand where is the problem?
      Is there any other method to connect to the DB?
      And how can I see the reason why my connection fails?

      I'm fighting 2 days with that problem so any advice will be appreciated!
      Thanks.