gpt4 book ai didi

python - 属性错误: 'NoneType' object has no attribute 'DoCmd'

转载 作者:行者123 更新时间:2023-12-01 09:13:32 24 4
gpt4 key购买 nike

无法弄清楚我做错了什么。这是代码:

import smtplib
import win32api,time
import pypyodbc
from win32com.client import Dispatch

DbName = 'C:/Users/billybob643/Documents/Database1.accb'
Access = Dispatch("Access.Application")
Access.OpenCurrentDatabase(DbName)
DbAccess = Access.CurrentDb()
DbAccess.DoCmd.RunMacro("00")

任何帮助将不胜感激。谢谢!

最佳答案

DoCmd 是 Access Application object 的成员.

通过您创建的Access.Application对象变量引用它...

Access.DoCmd.RunMacro("00")

关于python - 属性错误: 'NoneType' object has no attribute 'DoCmd' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51446817/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com