Simple Database connection failed [message #187167] |
Fri, 11 August 2006 03:37 |
Gunnar.tr
Messages: 2 Registered: August 2006
|
Junior Member |
|
|
Hi,
I have a problem with creating a connection to a Oracle 10g Database. I have a C++ program an work with the Microsoft Visual C++ 6.0. My problem refers to the following code:
#include "stdafx.h"
#include <stdio.h>
#include <iostream.h>
#include <occi.h>
using namespace std;
using namespace oracle::occi;
void main(void)
{
cout<<endl<< "Program started"<<endl<<endl;
const string user = "Scott";
const string password = "Tiger";
const string database = "testdb";
try{
Environment *env = Environment::createEnvironment();
{
Connection *conn = env->createConnection(user,password,database);
cout<<"Yeeehha i have a connection";
cout<<endl;
env->terminateConnection(conn);
}
Environment::terminateEnvironment(env);
}
catch (exception &excp)
{
cout<<"Fail"<<endl;
cout<<excp.what()<<endl;
}
}
Actually I want to make first times only one connection to the data base, which normally no problem should be. But every time I want to run the program come the following Error:
ORA-24960: the attribute OCI_ATTR_USERNAME is greater than the maximum allowable length of 255
Does someone have an idea which cause of these errors to have could?
For suggestions I would be very grateful.
P.S. sorry for the bad English, but i’am German
Mfg gunnar
|
|
|
|