I'm having issues with the following lines of code:
print("Before")
conn = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=C:\\Users\\userName\\Desktop\\Project Folders\\sharepointList\\test.accdb;')
print("After")
I printed small messages before and after this line to narrow down where my program was stopping.
When I run my script I do not get an error message, the program simply stops. I know the program stops because the second print statement never happens.
the test.accdb
file referred to is linked to a SharePoint list. I am using SharePoint 2016.
I tried this same line of code with a different .accdb file, one that was not linked to a SharePoint list. The code finished and printed both print statements when I ran it. This leads me to believe that the issue is due to my list being linked to Sharepoint.
Here is the entirety of the code I am trying to run
import pyodbc
print("Before")
conn = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=C:\\Users\\userName\\Desktop\\Project Folders\\sharepointList\\test.accdb;')
print("After")
I replaced my actual username with userName
but everything else is accurate.
I expect the conn
variable to allow me to create a cursor, and from there allow me to add data to my .accdb file using pyodbc
.
Instead, I can't get past assigning something to the conn
variable.