i need help #1244
i need help
#1244
Replies: 1 comment 1 reply
-
You are using pypyodbc, not pyodbc. They are not the same thing. Also, you don't even mention what the error is, or where it occurs. Try asking for help on Stack Overflow |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i keep getting a error
import pypyodbc
Replace 'C:\Users\Melmc\OneDrive - Glow Scotland\Dylz1.accdb' with the actual full path to your Dylz1.accdb file
db_file = r'C:\Users\Melmc\OneDrive - Glow Scotland\Dylz1.accdb'
conn_str = f'Driver={{Microsoft Access Driver (*.mdb, *.accdb)}};DBQ={db_file};'
conn = None # Initialize conn outside the try block
try:
conn = pypyodbc.connect(conn_str)
cursor = conn.cursor()
except Exception as e:
print("An error occurred:", e)
finally:
# Make sure to close the connection after use
if conn is not None:
conn.close()
Beta Was this translation helpful? Give feedback.
All reactions