Microsoft Access 2007 和 2010:“运行时错误‘429’:ActiveX 组件无法创建对象”
我正在尝试修复从 Access 97 格式导入到 Access 2007 格式(.mdb 到 .accdb)的 Microsoft Access 数据库。导入成功,我能够在我的机器上使数据库完全发挥作用。它在我同事的机器上也能正常运行。但是,当带到我们组织的另一栋建筑时,我们无法运行数据库。我们知道部分问题在于打开与保存中央数据库的 Web 服务器的连接(该 Access 数据库有多个副本,它们包含相同的代码,但输入不同的数据并上传到该中央数据库) )。这是代码。
Public Function updateSqlServer(TransType As String, SqlCommand As Variant) As Boolean
Dim xmldom As New MSXML2.DOMDocument40
Dim xmlhttp As New MSXML2.ServerXMLHTTP40
Const SoapServer = "http://www.example.com/webservice.asp"
'setup the XMLHTTP object and POST envelope to SoapServer
toResolve = 5 * 1000
toConnect = 5 * 1000
toSend = 15 * 1000
toReceive = 15 * 1000
xmlhttp.setTimeouts toResolve, toConnect, toSend, toReceive
xmlhttp.Open "POST", SoapServer, False 'YIELDS Run-Time Error 429 on this line: xmlhttp.Open
xmlhttp.setRequestHeader "Man", POST & " " & SoapServer & " HTTP/1.1"
xmlhttp.setRequestHeader "MessageType", "CALL"
xmlhttp.setRequestHeader "Content-Type", "text/xml"
xmlhttp.send (SoapEnvelope)
'synchronous wait for response; HTTP status other than 200 (OK) is an error
If xmlhttp.Status = 200 Then
Set xmldom = xmlhttp.responseXML 'get response into XML DOM document
Debug.Print (xmldom.xml) 'write soap response to screen
updateSqlServer = True
Else
'handle error
Debug.Print ("Didn't Work")
Debug.Print ("status=" & xmlhttp.Status) 'write soap return code
Debug.Print ("" & xmlhttp.statusText) 'write status text
updateSqlServer = False
End If
Set xmlhttp = Nothing
Set xmldom = Nothing
End Function
我们尝试解决此问题的方法: 1. 添加了所有必要的引用(例如 Microsoft XML) 2. 编辑文件和文件夹的权限 3. 注册ActiveX控件 4. 确保所有可以更改的选项在工作和非工作机器上都匹配
。这个旧的不是我的代码或设计。我只需要修复它。 任何帮助将不胜感激。
I am trying to fix a Microsoft Access database that was imported from Access 97 format to Access 2007 format (.mdb to .accdb). The import was successful and I was able to make the database fully functional from my machine. It is also fully functional from my coworker's machine. However, when taken to another building that is part of our organization, we cannot get the database to run. We know that part of the problem is within opening a connection to the web server that holds the central database (there are several copies of this Access database that consist of the same code, but different data is input into them and uploaded to this central database). Here is the code.
Public Function updateSqlServer(TransType As String, SqlCommand As Variant) As Boolean
Dim xmldom As New MSXML2.DOMDocument40
Dim xmlhttp As New MSXML2.ServerXMLHTTP40
Const SoapServer = "http://www.example.com/webservice.asp"
'setup the XMLHTTP object and POST envelope to SoapServer
toResolve = 5 * 1000
toConnect = 5 * 1000
toSend = 15 * 1000
toReceive = 15 * 1000
xmlhttp.setTimeouts toResolve, toConnect, toSend, toReceive
xmlhttp.Open "POST", SoapServer, False 'YIELDS Run-Time Error 429 on this line: xmlhttp.Open
xmlhttp.setRequestHeader "Man", POST & " " & SoapServer & " HTTP/1.1"
xmlhttp.setRequestHeader "MessageType", "CALL"
xmlhttp.setRequestHeader "Content-Type", "text/xml"
xmlhttp.send (SoapEnvelope)
'synchronous wait for response; HTTP status other than 200 (OK) is an error
If xmlhttp.Status = 200 Then
Set xmldom = xmlhttp.responseXML 'get response into XML DOM document
Debug.Print (xmldom.xml) 'write soap response to screen
updateSqlServer = True
Else
'handle error
Debug.Print ("Didn't Work")
Debug.Print ("status=" & xmlhttp.Status) 'write soap return code
Debug.Print ("" & xmlhttp.statusText) 'write status text
updateSqlServer = False
End If
Set xmlhttp = Nothing
Set xmldom = Nothing
End Function
Things we have tried to fix this problem:
1. Added all necessary references (Ex. Microsoft XML)
2. Editing the permissions of the file and the folders
3. Registering ActiveX Controls
4. Made sure all options that can be changed match on both working and non-working machines
This old and is not my code or design. I just have to fix it.
Any help will be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的一位同事找到了答案。这些变量是 MSXML4 的对象,而 Windows 7 预装了 MSXML 6.0,它显然与 MSXML 4 不兼容。
请务必检查安装包强> 首先。
您可以安装 MSXML 4 或通过以下方式将变量更改为
MSXML 6
:而不是
A coworker of mine figured out the answer. Those variables are objects of MSXML4, and Windows 7 comes stock with MSXML 6.0, which is evidently not compatible with MSXML 4.
Make sure to check install packages before anything else.
You can either install MSXML 4 or change the variables to
MSXML 6
by:instead of