Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: What do I need for an ODBC connection to Oracle 9i with VC++?
The ret_code is -1. There is a file named sqlnet.log which says:
Fatal NI connect error 12560, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oracleORCL)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))(CONNECT_DATA=(SID=ORCL)(CID=(PROGRAM=D:\EPI-Projekt\EPI\Debug\cdemo81.exe)(HOST=LE040)(USER=zenner))))
VERSION INFORMATION:
TNS for 32-bit Windows: Version 9.0.1.1.0 - Production
Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 9.0.1.1.0 - Production
Time: 15-APR-2003 15:13:16
Tracing not turned on.
Tns error struct:
nr err code: 0
ns main err code: 12560
TNS-12560: TNS: Protokolladapterfehler (protocol adaptor failure)
ns secondary err code: 0
nt main err code: 530
TNS-00530: Protokolladapter-Fehler
nt secondary err code: 126
nt OS err code: 0
I have searched the net for docs and how-to's but I haven't found anything appropriate. The file i try now is from technet.oracle.com, a sample code file.
Ron Reidy schrieb:
> What do you mean "does not work"? What are the errors? Have you read
> any Oracle docs on networking?
>
> --
> Ron Reidy
> Oracle DBA
>
> Roland Zenner wrote:
> > Hello!
> >
> > I want to create a connection using ODBC and VC++.
> > What do I need and how can I do that?
> > This code does not work...
> > ret_code = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE,
> > &henv); // Environment-Handle holen (ODBC-Manager installiert?)
> > if ((ret_code==SQL_SUCCESS) || (ret_code==SQL_SUCCESS_WITH_INFO))
> > {
> > ret_code = SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)
> > SQL_OV_ODBC3, SQL_NTS);
> > if ((ret_code==SQL_SUCCESS) || (ret_code==SQL_SUCCESS_WITH_INFO))
> > {
> > ret_code = SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc); if
> > ((ret_code==SQL_SUCCESS) || (ret_code==SQL_SUCCESS_WITH_INFO))
> > {
> > ret_code = SQLConnect(hdbc, (SQLTCHAR*)dbname, SQL_NTS,
> > (SQLTCHAR*)name, SQL_NTS, (SQLTCHAR*)pw, SQL_NTS);
> > if ((ret_code==SQL_SUCCESS) || (ret_code==SQL_SUCCESS_WITH_INFO))
> > connection_flag=0L;
> >
> > Greetz
> > Roland
Received on Tue Apr 15 2003 - 08:18:03 CDT