Easysoft
ODBC Drivers for Oracle, SQL Server, Firebird, ISAM, InterBase, Sybase, MS Access & more.

Easysoft ODBC-ODBC Bridge

I don't like my odbc.ini in the same directory as my PHP/Perl script as people browsing my web site may see it and it contains passwords. What do I do?

Article : 00079
Last Reviewed : 19th July 2005
Revision : 1

You can place your odbc.ini file in the current users home directory or in the file pointed to by the ODBCINI environment variable. You can also put your DSNs in /etc/odbc.ini. You can also place the sensitive information in the call to SQLDriverConnect by setting the attributes in the in_connection_string parameter.

e.g. SQLDriverConnect(dbc,
"DSN=dsn_name;LOGONUSER=username;LOGONAUTH=password;",
...);

Attributes set in the in_connection_string argument to SQLDriverConnect override values in the odbc.ini file.

To set the ODBCINI environment variable from PHP use:
putenv ("<path>/odbc.ini");

To see what environment variables are set to from PHP use:
phpinfo();

Applies To

Knowledge Base Feedback

* Did this content help you?
Yes
No
Maybe
 
* Please select one option based on your first choice:
I'm very satisfied
I think it will help, but I haven't tried it yet
It is helpful, but I need more information
It is helpful, but hard to understand
Seemed relevant in search results, but didn't help me
The information is incorrect
The page contains one or more broken links
 
  Suggest new content or let us know how we can improve this content:

 
  (* Required Fields)   



© 1993 - 2008 Easysoft Limited. All rights reserved.