R에서 .COM 개체를 사용하여 OLAP 큐브에 ADODB.Connection을 설정하고 싶습니다. 그리고 나는 rscproxy, rcom 및 statconnDCOM 패키지를 사용하고 있습니다.R & COM 개체 : Windows에서 OLAP 큐브에 연결하는 방법
그러나, 나는 RCOM 패키지에 대한 유용한 문서를 찾는 정말 성공하지 않다, 따라서, 나는 R.에서 .COM 객체를 사용하여 큰 시간을 고투하고 나는 .COM 개체를 만들 수 있어요
,하지만 나는 다음 단계에 대해 전혀 모른다. 내가하고 싶은 것 :
- 는
- 는 R을 열고 연결 문자열을 설정 < -> 큐브 연결
- 는
이 저를 도와주세요 MDX 쿼리를 실행 this :-)
.
코드 :
# I am quite confident that this section is right:
library(rcom)
conn <- comCreateObject("ADODB.Connection")
# From now on it becomes speculative:
comGetObjectInfo(conn)
connStr = 'Provider=MSOLAP;Data Source=...;Initial Catalog=...;'
# First try to set the connection string:
comSetProperty(conn,"ConnectionString",connStr)
# Second try to set the connection string:
conn[["ConnectionString"]] = connStr
# I try to establish the connection:
conn$Open
.
기타 정보 :이 R-3.3.1에 언급 - 위의 패키지를 설치하기 위해 나에게 꽤 걸렸다 때문에
, 나는 내가 할 관리 방법에 대한 간략한 개요를주고 싶다 :
.libPaths()
options(install.packages.check.source = "no")
install.packages(c("rscproxy","rcom"),repos="http://www.autstat.com/download",lib=.Library,type="win.binary")
installstatconnDCOM()
library(rcom)
comRegisterRegistry()
sessionInfo()