<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thanks, that made a change.<BR><BR>I added the lib path /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib to LD_LIBRARY_PATH. The error message changed when I ran my testprogram ls from the command line:<BR><BR>ken@ken-desktop:~/projects/ls/bin/Debug$ ./ls<BR>Usage error: SQLConnect: dsn=oracledsn, user=dba, password=abcd<BR>1: st=IM004, nerr=0, msg=<BR>[unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed<BR>2: st=00000, nerr=0, msg=<BR>[unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed<BR> Press Return/Enter to continue<BR><BR>Exit(0)<BR><BR>The program fails on the SQLConnect:<BR><BR>   char msg [ 100 ] ;<BR>   rc = SQLConnect ( hdbc , (SQLCHAR*)datasourcename , SQL_NTS,<BR>                      (SQLCHAR*) userid , SQL_NTS,<BR>                      (SQLCHAR*) password , SQL_NTS);<BR>   if ( !success
 ( rc ) )<BR>      {<BR>      sprintf ( msg , "SQLConnect: dsn=%s, user=%s, password=%s" ,<BR>               datasourcename , userid , password ) ;<BR>      sqlerrinfo ( SQL_HANDLE_DBC , NULL , (int)hdbc , msg ) ;<BR>      shret-&gt;rc = rc ;  // in server handle of my old sql api<BR>      SQLFreeConnect ( hdbc ) ;<BR>      SQLFreeEnv ( henv ) ;<BR>    printf ( "Exit(0)\n" ) ;  // +++ for now 8 May 2009<BR>    exit ( 0 ) ;              // +++ for now<BR>      return false ;<BR>      } ;<BR><P></P><P>Sorry, lost indentation. How to request the text to be left as is?<BR></P><P></P>The sql calls before the SQLConnect were OK, i.e. these:<BR><BR>   rc = SQLAllocHandle ( SQL_HANDLE_ENV , SQL_NULL_HANDLE , &amp;henv ) ;<BR>   rc = SQLSetEnvAttr ( henv, SQL_ATTR_ODBC_VERSION , *)SQL_OV_ODBC3 , 0 ) ;<BR>   rc = SQLAllocHandle ( SQL_HANDLE_DBC , henv , &amp;hdbc ) ;<BR>   SQLSetConnectAttr ( hdbc , SQL_LOGIN_TIMEOUT , (void*)5 , 0 ) ;<BR><BR>The
 SQLAllochandle was successful, so I do not understand the error message that reports problems with SQLAllocHandle after the SQLConnect call.<BR><BR>The dsn=oracledsn, user=dba, password=abcd are just taken from the Windows program. The userid and password are certainly not meaningful now and I would expect authentication error of type userid and/or password invalid. I want to connect to the Oracle sample database and issue a few selects and fetchscrolls for testing ODBC, but I do not know how how to specify the dsn,user and password for this.<BR> <BR>Ken<BR><BR><BR>Nick wrote<BR><BR>Add the path to the LD_LIBRARY_PATH, it affects the run time resolution of lib searches;<BR><BR>-- Nick<BR><BR><BR><BR></td></tr></table><br>
      <hr size=1> <a href="http://sg.rd.yahoo.com/aa/mail/domainchoice/mail/signature/*http://mail.promotions.yahoo.com/newdomains/aa/"> Get your new Email address! </a> <br>
Grab the Email name you&#39;ve always wanted before someone else does!