Click to See Complete Forum and Search --> : oracle 10g error 24960


manic dude
November 3rd, 2007, 11:12 PM
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::DEFAULT);
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.

Krzemo
November 4th, 2007, 10:08 PM
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:
conn = env->createConnection("system","xxx","Testx");


Best regards,
Krzemo.

manic dude
November 5th, 2007, 04:23 AM
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.

Dhpatil1
January 29th, 2009, 05:42 AM
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::occi;
using namespace std;

try{

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

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