0

I'm having trouble connecting my python program to my access database relatively. My python file and database are stored in the same file however as I need to use the code on different pcs the file directory wont be the same

conn = pyodbc.connect(r'Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:\Folder\Database.accdb;')

My python file is also stored in the 'Folder' Folder however I'm just being told it is not a valid path

  • related: https://stackoverflow.com/a/3430395/2144390 – Gord Thompson Nov 16 '22 at 19:53
  • Does this answer your question? [How do I get the full path of the current file's directory?](https://stackoverflow.com/questions/3430372/how-do-i-get-the-full-path-of-the-current-files-directory) – June7 Nov 16 '22 at 20:01

0 Answers0