error handling for pyodbc

added error handling for pyodbc connection