Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Microsoft Access数据库引擎找不到输入表或查询_Python_Ms Access_Pyodbc_Python Db Api - Fatal编程技术网

Python Microsoft Access数据库引擎找不到输入表或查询

Python Microsoft Access数据库引擎找不到输入表或查询,python,ms-access,pyodbc,python-db-api,Python,Ms Access,Pyodbc,Python Db Api,我正在尝试与Microsoft Office建立连接并运行查询,但显示错误 这是我的密码: 导入pyodbc conn=pyodbc.connect(r'DRIVER={Microsoft Access驱动程序(*.mdb,*.accdb)};DBQ=E:\Python\Database\att2000.accdb;') 游标=连接游标() cursor.execute(“从att2000中选择CHECKINOUT,其中CHECKTYPE=O”) 对于cursor.fetchall()中的行:

我正在尝试与Microsoft Office建立连接并运行查询,但显示错误

这是我的密码:

导入pyodbc
conn=pyodbc.connect(r'DRIVER={Microsoft Access驱动程序(*.mdb,*.accdb)};DBQ=E:\Python\Database\att2000.accdb;')
游标=连接游标()
cursor.execute(“从att2000中选择CHECKINOUT,其中CHECKTYPE=O”)
对于cursor.fetchall()中的行:
打印(行)
以下是错误:

Error is occurring while executing the query
----> 5 cursor.execute("SELECT CHECKINOUT FROM att2000 Where CHECKTYPE = O")
      6 
      7 for row in cursor.fetchall():

ProgrammingError: ('42S02', "[42S02] [Microsoft][ODBC Microsoft Access Driver] The Microsoft Access database engine cannot find the input table or query 'att2000'. Make sure it exists and that its name is spelled correctly. (-1305) (SQLExecDirectW)")

我猜你把文件名和表名弄混了

尝试:


att2000
是数据库文件的名称。显然,它不包含也被命名为
att2000
的表或视图。在Microsoft Access UI中打开数据库,并验证表/视图的名称。
cursor.execute("Select * From CHECKINOUT Where CHECKTYPE = O")