Konnte keine Datei finden '(unbekannt)' ''

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Konnte keine Datei finden '(unbekannt)' ''

by Anonymous » 14 Feb 2025, 15:16

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.

Top