Hello,
I am new with R and I am trying to create a connection to our Oracle Database. In VBA we use the following code, which works perfekt:
Set cnn = New ADODB.Connection
sCnn = "DSN=DSN_NAME;" _
& "UID=USER_NAME;" _
& "PWD=USER_PASSWORD;" _
& "DBQ=DBQ_NAME;" _
& "DRIVER={Microsoft ODBC for Oracle};"
With cnn
.ConnectionString = sCnn
.Open
End With
In R I have tried several possibilities with ODBC and RODBC, but none works. For example:
myConn <-odbcDriverConnect("Driver={{Microsoft ODBC for Oracle};DBQ=xxx;uid=xxx;Pwd=xxx;")
Error in odbcDriverConnect("Driver={{Microsoft ODBC for Oracle};DBQ=xxx;uid=xxx;Pwd=xxx;") :
could not find function "odbcDriverConnect"
Or:
con <- odbc::dbConnect(odbc::odbc(), dsn=dsn_name, uid=user_name, pwd=pw)
Error: nanodbc/nanodbc.cpp:950: IM014: [Microsoft][ODBC Driver Manager] Der angegebene DSN weist eine nicht übereinstimmende Architektur von Treiber und Anwendung auf.
Can somebody help me setting up a connection to the Oracle database?
Cheers,
Andi