CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2007
    Posts
    2

    oracle 10g error 24960

    If i compile with visual c++ 6.0 or 2005 i get the same problem.

    /////////
    string user = "system";
    string passwd = "xxx";
    string db = "Testx";

    try{
    env = Environment::createEnvironment(Environment:EFAULT);
    conn = env->createConnection(user,passwd,db);

    }catch(SQLException ea)
    {
    cerr << ea.getMessage() << endl;
    }
    //////////

    the message is "ORA-24960: the attribute OCI_ATTR_USERNAME is greater than the maximum allowable length of 255"

    I have tried downloading the library's on oracle.com for the 8.0 version but the error doesn't not change. I am pretty sure that I included all of the correct directories into the project.

    I also added the directory to windows PATH but then I get msvcrt80.dll missing error.

  2. #2
    Join Date
    Nov 2004
    Location
    Poland
    Posts
    1,355

    Re: oracle 10g error 24960

    Are U sure that createConnection expects parameters of type "string"?
    Message "ORA-24960: the attribute OCI_ATTR_USERNAME is greater than the maximum allowable length of 255" indicates that it is not true.
    ;-)
    try to hardcode invocation just to see if that is a problem - for example:
    Code:
    conn = env->createConnection("system","xxx","Testx");
    Best regards,
    Krzemo.

  3. #3
    Join Date
    Nov 2007
    Posts
    2

    Re: oracle 10g error 24960

    I've tried that but it is still the same exception at runtime.

    The code itself should be fine since it is just a pared down version of a sample off of the oracle website.

  4. #4
    Join Date
    Jan 2009
    Location
    India
    Posts
    13

    Re: oracle 10g error 24960

    I'm getting the following exception "ORA-24960: the attribute OCI_ATTR_USERNAME is greater than the maximum allowable length of 255" when using Environment:createConnection.
    I'm using VisualC++ 8.0 and Oracle 10g R 10.2.0.


    Below is the snippet of code that creates the problem:
    #include <iostream>
    #include<occi.h>
    using namespace oracle:cci;
    using namespace std;

    try{

    Environment *env = Environment::createEnvironment(Environment:EFAULT);
    Connection *conn = env->createConnection ("scott","tiger");

    }
    catch(SQLException ex)
    {
    cout << ex.getMessage(); //throws 24960 error
    }

  5. #5
    Join Date
    May 2023
    Posts
    1

    Re: oracle 10g error 24960

    Quote Originally Posted by manic dude View Post
    the message is "ORA-24960: the attribute OCI_ATTR_USERNAME is greater than the maximum allowable length of 255"
    Using the debug library (oraocci11d.lib, vc9; NOT oraocci11.lib) for the debug mode did the trick for me (Toolset VS2008 [v90] in VS2017).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured