Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Unable to connect to the database using Pro*C/C++
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
![]() |
![]() |