Connection issue - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Connection issue (/thread-20651.html) |
Connection issue - metro17 - Aug-23-2019 Warning: This Python interpreter is in a conda environment, but the environment has not been activated. Libraries may fail to load. To activate this environment please see https://conda.io/activation Type "help", "copyright", "credits" or "license" for more information. >>> import pyodbc >>> conn = pyodbc.connect('Driver={SQL Server};' ... 'Server=ServerA;' ... 'Database=TestDb;' ... 'Trusted_Connection=yes;') >>> >>> cursor = conn.cursor() >>> cursor.execute('SELECT * FROM TestDb.PatientAppointments')
>>> >>> for row in cursor: ... print(row) ... |