Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Unable to connect to the database using Pro*C/C++

Re: Unable to connect to the database using Pro*C/C++

From: Rauf Sarwar <rs_arwar_at_hotmail.com>
Date: 6 Jan 2005 04:47:56 -0800
Message-ID: <1105015676.135050.239290@z14g2000cwz.googlegroups.com>

Xavier Darcos via OracleMonster.com wrote:
> Hello,
>
> I am trying to understand Pro*C/C++. Thus, I used the samples
provided by Oracle 8i (and in particular cppdemo01 project).
>
> I generated the .cpp from the .pc and build my project:
cppdemo01.exe.
>
> When executing it, I get "ORA-12560: TNS: protocol adapter error".
>
> Extract of th .pc file:
> username.len = (unsigned short)strlen(strcpy((char *)username.arr,
"test"));
> password.len = (unsigned short)strlen(strcpy((char *)password.arr,
"test"));
> dbname.len = (unsigned short)strlen(strcpy((char *)dbname.arr,
"BDDEV1"));
> EXEC SQL CONNECT :username IDENTIFIED BY :password AT: dbname;

<snip>

Try
EXEC SQL CONNECT :username IDENTIFIED BY :password USING :dbname; Regards
/Rauf Received on Thu Jan 06 2005 - 06:47:56 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US