2 Replies Latest reply on Jun 6, 2013 1:40 PM by CBikram

    ORA-24960 error in Visual Studio 2008, OCCI 11.2


      I read some old related posts from this forum and already tried what suggested. So hopefully this is not a duplicate post.

      I am quite new with OCCI. Building a native driver for erlang. I already got a native OCI driver successfully working but code gets big and messy so decided to use the awesome OCCI interface.

      Compile and link went ok, but now stuck with createConnection exception *"ORA-24960: Das Attribut OCI_ATTR_USERNAME ist gr**er als die maximal zulõssige Lõnge von 255"*(Developing on a laptop with language German). I have tried some alternatives for couple of days now still in same darkness. The same piece of code is working in another CentOs with same version of instant client library. None of this machine has any oracle server installed only instantclient library files and trying to connect with a remote oracle server.

      After reading and searching around a little bit, I came to understanding that this might be a problem between incompatibility between the oraocci11.dll build VS version and the my VS version, so here are some versions if it might help:
      instantclient_11_2/oraocci11.dll (size 1'235'456 bytes)
      instantclient_11_2/vc9/oraocci11.dll (size 1'127'936 bytes)
      Visual Studio 2008 Ver 9.0.21022.8 RTM .NET 3.5 SP1

      I am quite at loss to figure out the next step to solve this problem. What might I be missing? Any help pointer is will be very highly appreciated.

      Thanks in advance,
        • 1. Re: ORA-24960 error in Visual Studio 2008, OCCI 11.2
          jim dc
          Have you ruled out the instant client / debug mode problem mentioned in older threads?

          Other than that I would be inclined to take the error message at face value. What string are you passing in for username and is it a UString, wstring or string?

          Good luck
          1 person found this helpful
          • 2. Re: ORA-24960 error in Visual Studio 2008, OCCI 11.2
            Thanks JimDC for your reply.

            I am not sure what do you mean by "instant client / debug mode problem" from old threads. Currently I am building and running OCCI in debug mode without any other problem. However after reading your reply I tired to make a Release mode build of the same OCCI program and got into a __security_check_cookie LINK2001 error. Not sure if it has anything to do with occi libraries because of the /GS flag.

            Edit: Ok I figured this one out. Now I have a better understanding of what do you mean by instant client problem. The release mode build is going through the connect but retrieval of columns count afterwards with vector<MetaData> listOfColumns.size() (select * from all_tables) crashes (listColumns.size() returns 18446744073709402101). Debug mode build is still stuck with the same ORA-24960 problem.

            Though I don't need a release build now, since I will be developing/debugging further (after I overcome this problem). But if you think the released oraocci11dll only works in release mode then I can try that out --(though not sure how can I fix the Linker error reported above)--.

            Given below the occitest.cpp I am trying to run (replaced username/password/ip with equal number of characters):
            #include "stdafx.h"

            #include <iostream>
            #include <occi.h>

            using namespace std;
            using namespace oracle::occi;

            int tmain(int argc, TCHAR* argv[])
                 const char* userName = "scott";
                 const char* password = "tiger";
                 const char* connectString = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=";
                 const char* sql = "SELECT * FROM ALL_TABLES";

                 try {
                      Environment *env = Environment::createEnvironment(Environment::THREADED_MUTEXED);
                      Connection conn = env->createConnection((char)userName, (char*)password, (char*)connectString);
                      cout << "success!!!!" << endl;
                 } catch (std::exception const & ex) {
                      cout << ex.what() << endl;
                 } catch (std::string const & ex) {
                      cout << ex << endl;
                 } catch (...) {
                      // ...

                 return 0;
            Thanks again

            Edited by: 1010085 on Jun 6, 2013 6:29 AM

            Edited by: 1010085 on Jun 6, 2013 6:40 AM