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.
Comment on Re: Connection to SQL not working through web browser