Home » Developer & Programmer » Precompilers, OCI & OCCI » Simple Database connection failed
Simple Database connection failed [message #187167] Fri, 11 August 2006 03:37 Go to next message
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
Re: Simple Database connection failed [message #187230 is a reply to message #187167] Fri, 11 August 2006 07:17 Go to previous message
Gunnar.tr
Messages: 2
Registered: August 2006
Junior Member
Yeaaaha,

I solved the problem!! I have used the wrong Instandclient Embarassed ! Thus vc70 instead of vc60! Now everything functions: -) Cool !
Previous Topic: spatial object retrieval using OCI
Next Topic: Need 10g - (10.1.0.4 ) version Pro*C/C++ Precompiler
Goto Forum:
  


Current Time: Thu Mar 28 03:29:13 CDT 2024