Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> ODBC and Oracle 7.3.2.2
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
![]() |
![]() |