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: What do I need for an ODBC connection to Oracle 9i with VC++?

Re: What do I need for an ODBC connection to Oracle 9i with VC++?

From: Roland Zenner <R_Zenner_at_yahoo.de>
Date: Mon, 21 Apr 2003 21:02:21 +0200
Message-ID: <b81f6r$550u1$1@ID-190804.news.dfncis.de>


I do get a connection with SQLPLUS, but not with ODBC...

--
MfG
Roland Zenner
"Amit" <jindal_at_roguewave.com> schrieb im Newsbeitrag
news:b7nb0g$7k1$1_at_tux.cvo.roguewave.com...

> Try connecting through SQLPLUS first. That will establish correct
> connectivity before you attempt ODBC.
>
> - AMit
>
> "Roland Zenner" <zenner_at_iff.fhg.de> wrote in message
> news:3E9BFE8C.8C691BBC_at_iff.fhg.de...
> > 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 Mon Apr 21 2003 - 14:02:21 CDT

Original text of this message

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