gdef connect(query):
    """Sets up a DB connection and runs a query. Returns the recordset"""
    connection = pyodbc.connect('[The Connection String Works]', autocommit=True)
    print "Query as it goes in to be executed:"
    print query
    cursor = connection.execute(query)
    connection.commit()
    return cursor
    

def getQueryResults(query):
    """Pulls down the results of a query and returns the whole thing as an array of tuples."""
    cursor = connect(query)
    print cursor
    row = cursor.fetchone()
    finalArray = []
    while row:
        finalArray.append(row)
        row = cursor.fetchone()
        
    cursor.close()
    del cursor
    return finalArray
