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 
}
K._106 commented: Using the debug library (oraocci11d.lib, vc9) in debug mode did the trick for me (VS2008, v90). +0

There's a typo in your code. I think you mean Environment::DEFAULT instead of Environment:EFAULT . I never heard of the second anyway ;)

Environment *env = Environment::createEnvironment(Environment:: DEFAULT ); i type but same problem

Here's a related thread, maybe it can help you

and this will help everyone a LOT !!!

code Tags

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.