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: Ron Reidy <rereidy_at_indra.com>
Date: Tue, 15 Apr 2003 07:06:31 -0600
Message-ID: <3E9C03D7.6000107@indra.com>


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:06:31 CDT

Original text of this message

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