Excel Macro VBA CopyFromRecordSet以检索Microtocus ALM数据提供了类,而不是支持自动化(错误430)
我正在尝试通过Excel VBA运行SQL查询,以将Microfocus ALM数据提取到Excel电子表格,但我正在击中“类不支持自动化或不支持预期接口”错误,错误代码430。
我启用了库Microsoft” Microsoft” Activex数据对象记录集2.8库“参考中。在搜索论坛后,我发现了使用以下命令添加msado15.dll的建议。
Regsvr32.exe "C:\Program Files\Common Files\System\ado\msado15.dll"
我也尝试过,但仍然存在同样的问题。以下是我使用的代码,并在最后一行中点击错误,我尝试将数据加载到“测试”选项卡中。当我在Recset变量上添加手表时,我确实看到Recset执行SQL后,加载了70个Colcount和1358 RecordCount,但是在最后一步中,将数据加载到ExceL excecel我面临问题。对此的任何帮助将不胜感激。谢谢
Set QCConnection = CreateObject("TDApiOle80.TDConnection")
QCConnection.InitConnectionEx qcURL
QCConnection.ConnectProjectEx sDomain, sProject, sUser, sPass
Application.StatusBar = "Logged in ALM as " & sUser
Set com = QCConnection.Command
Sql = "select * FROM BUG"
com.CommandText = Sql
Set RecSet = com.Execute
ThisWorkbook.Sheets("test").Range("A1").CopyFromRecordset RecSet 'Error 430
I am trying to run a SQL query through Excel VBA to extract MicroFocus ALM data to excel spreadsheet but I am hitting the "Class does not support Automation or does not support expected Interface" error, Error Code 430.
I have enabled the library "Microsoft ActiveX Data Object Recordset 2.8 Library" in the References. After searching for forums I found a suggestion to add the msado15.dll using the below command.
Regsvr32.exe "C:\Program Files\Common Files\System\ado\msado15.dll"
I tried that too, but still the same issue. Below is the code I use and I hit error in the last line where I try to load data to "test" tab. When I add watch on the RecSet variable, I do see that RecSet is loaded with 70 ColCount and 1358 RecordCount after the SQL is executed, but in the last step to load the data to excel I am facing problem. Any help on this is appreciated. Thanks
Set QCConnection = CreateObject("TDApiOle80.TDConnection")
QCConnection.InitConnectionEx qcURL
QCConnection.ConnectProjectEx sDomain, sProject, sUser, sPass
Application.StatusBar = "Logged in ALM as " & sUser
Set com = QCConnection.Command
Sql = "select * FROM BUG"
com.CommandText = Sql
Set RecSet = com.Execute
ThisWorkbook.Sheets("test").Range("A1").CopyFromRecordset RecSet 'Error 430
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从ALM服务器安装ALM客户端或ALM连接工具:
http:// almserver:8080/qcbin/addins.html
Install ALM Client or ALM Connectivity Tool from your ALM server:
http://almserver:8080/qcbin/addins.html