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 -> ODBC and Oracle 7.3.2.2

ODBC and Oracle 7.3.2.2

From: Joop van de Wege <Joop.vandeWege_at_medew.ento.wau.nl>
Date: 1997/05/01
Message-ID: <3368a20b.0@142.155.129.4>#1/1

Hello All,

I have a working connection to Oracle Workgroup Server 7.3.2.2 on a NT4 server but the username and password are hardcoded into the program and I would like to omit them. I know that setting 'identified external' will allow me to log in to Oracle using my NT account and it works with SQLPlus and the ODBCtest program. I'm using ODBC 1.16.3.1.5 and the following code snippet:

BOOL init_odbc(UCHAR *server)
{

/* :server = ODBC user Data Source                                       */
        char full_connect[255]={'\0'};
        char dsn[255]={'\0'};
        short full_len=0;
        long rc;

        SQLAllocEnv(&henv);
        SQLAllocConnect(henv, &hdbc);
        sprintf(dsn, "DSN=%s;", server);
        rc = SQLDriverConnect(hdbc, NULL, &dsn[0], (short)strlen(dsn), \
                &full_connect[0], 255, &full_len, SQL_DRIVER_NOPROMPT);
        if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO)
        {
                LogODBCErrors(SQL_NULL_HENV, hdbc, SQL_NULL_HSTMT);
                return(FALSE);
        }
        else
                return(TRUE);

}

Using sprintf(dsn, ""DSN=%s;UID=test;PWD=test", server); works as expected but leaving out UID/PWD will give me an ODBC state 28000: authorization failed.

Anyone know how to log into Oracle using ODBC without revealing UID/PWD? (already done: os_authent_prefix="" in initorcl.ora)

Thanks for any help,

Joop



Joop van de Wege
Mobile Computing Consultants
+31 (0) 318 553292 Received on Thu May 01 1997 - 00:00:00 CDT

Original text of this message

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