Excel Macro VBA CopyFromRecordSet以检索Microtocus ALM数据提供了类,而不是支持自动化(错误430)

发布于 2025-01-31 08:02:26 字数 887 浏览 2 评论 0原文

我正在尝试通过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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撕心裂肺的伤痛 2025-02-07 08:02:26

从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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文