in reply to Connection to SQL not working through web browser

    print "Could not open connection to DSN because of [$!]";

I see nothing in the Win32::ODBC documentation which suggests that it sets $! on an error, but I do see that it supports an Error() method. Try that instead.