构建本地立方体
我需要为使用 Excel 的客户端构建本地 .cub 文件。
我已经收集了一些 VB 代码,但它失败了:
ConnLocation = "LOCATION=C:\test.cub;"
ConnDSN = "SOURCE_DSN=DSN=TEST;UID=test;PWD=pass;"
ConnCreateCube = _
"CREATECUBE=CREATE CUBE [TestCube] (" & _
"DIMENSION [account_code]);"
Connection = CreateObject("ADODB.Connection")
Connection.Provider = "msolap"
Connection.ConnectionString = _
ConnLocation & _
ConnDSN & _
ConnCreateCube
我已将其精简为上面的代码,但当我尝试运行它时,收到一个神秘的“OLE DB 错误:OLE DB 或 ODBC 错误。”。
对于上述问题的任何帮助或以不同方式解决此问题的建议将不胜感激。
I need to build a local .cub file for my Excel-using clients.
I have scrounged together some VB code but it fails :
ConnLocation = "LOCATION=C:\test.cub;"
ConnDSN = "SOURCE_DSN=DSN=TEST;UID=test;PWD=pass;"
ConnCreateCube = _
"CREATECUBE=CREATE CUBE [TestCube] (" & _
"DIMENSION [account_code]);"
Connection = CreateObject("ADODB.Connection")
Connection.Provider = "msolap"
Connection.ConnectionString = _
ConnLocation & _
ConnDSN & _
ConnCreateCube
I have trimmed this down to the above code and am getting a mysterious OLE DB error: OLE DB or ODBC error.
" when I try to run it.
Any help on the above or suggestions on a different way to approach this would me much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的连接字符串 DSN 属性似乎错误:
请注意引号。
我建议对代码进行一些小的更改,以使其更加直观和故障安全:
Your connection string DSN property seems wrong:
Note the quotes.
I would recommend a small code change to make it more intuitive and fail-safe: