Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Connection issue
#1
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')
Error:
Traceback (most recent call last): File "<stdin>", line 1, in <module> pyodbc.ProgrammingError: ('42S02', "[42S02] [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'TestDb.PatientAppointments'. (208) (SQLExecDirectW)")
>>>
>>> for row in cursor:
...     print(row)
...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  pysftp connection issue geil007 0 2,718 May-18-2022, 08:40 AM
Last Post: geil007
  Serial connection connection issue Joni_Engr 15 7,828 Aug-30-2021, 04:46 PM
Last Post: deanhystad
  connection string issue racone 2 3,668 Feb-03-2020, 02:22 AM
Last Post: racone

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020