Konnte keine Datei finden '(unbekannt)' ''Python

Python-Programme
Anonymous
 Konnte keine Datei finden '(unbekannt)' ''

Post by Anonymous »

Ich versuche etwas zu erstellen, das mit Zugriffsdatenbanktabellen funktioniert. < /p>
import pyodbc
import os

# Define the database file path
db_file = r'c:\Files\python_script\test.accdb' # Specify database file path

# Check if the file already exists
if not os.path.exists(db_file):
# Create the database file

connection_string = (
r'DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};'
r'DBQ=C:\Files\NIBE\Database1.accdb;'
)

conn = pyodbc.connect(connection_string)

< /code>
Ich erhalte den folgenden Fehler: < /p>
pyodbc.Error: ('HY000', "[HY000] [Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'. (-1811) (SQLDriverConnect); [HY000] [Microsoft][ODBC Microsoft Access Driver] Could not find file '(unknown)'. (-1811)")
< /code>
Was fehlt mir? Ich habe hier andere Beiträge für ähnliche Probleme gelesen, aber nichts scheint zu funktionieren.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post