[unixODBC-support] Doing a SQLDriverConnect fails in Apache with Error 500: "Internal Server Error"

Nick Gorham nick.gorham at easysoft.com
Wed Jun 18 09:48:35 BST 2008

Miguel Rentes wrote:

> Hi Nick,
> I've done more experiments on SQLDriverConnect and I would like to 
> have you opinion (and everybody's opinion too) on the results I've 
> encontered.
> I've changed the third argument passed to SQLDriverConnect and changed 
> from "DSN=SXDB;UID=scatex:PWD=Scatex;" to "DSN=DEFAULT;" and now I 
> don't have the "Internal Server Error" when I run the .cgi within a 
> web browser. But I don't get any results from the database either. 
> Should it be enough to put "DSN=DEFAULT;"?  Should the driver load the 
> system DSN  definitions when I only specify "DSN=DEFAULT;"?
> From what I can see, the unixODBC driver can't load the system DSN 
> (there's only one and it's SXDB) and can't get the definitions out of 
> ODBCINSTINI file. Below are my odbc.ini and odbcinst.ini (each at 
> /usr/local/etc):
I would guess that DSN=DEFAULT isn't loading a driver, as you don;t have 
a DSN called DEFAULT. Is your cgi doing any error checking? it sounds to 
me like the connect is failing with the DEFAULT option.

You need to distinguish between the driver and the driver manager, 
unixODBC is supplying the driver manager here, but all its doing is 
trying to determine the driver to load from the connection string, 
loading the driver, and then passing control to the driver. I suspect 
that the error is happening in the driver. Have you tried any other 
drivers just to see, or maybe to another database, PostgreSQL maybe ?

Nick Gorham
Easysoft Limited
http://www.easysoft.com, http://www.unixODBC.org

More information about the unixODBC-support mailing list