I have some issues while trying to combine my R script with PowerBI. I have some code that connects R with an Informix database via the RODBC package and I get data as dataframe with sqlquery.
The same code in PowerBI is not working unfortunately. A simple dataframe (e.g. iris) is loaded into BI, so the setup seems to be correct.
The R Code example is
library(tidyverse)
library(lubridate)
library(RODBC)
library(dplyr)
library(odbc)
library(DBI)
library(data.table)
conn <- odbcConnect("Server", uid = "xxx", pwd = "xxx")
labor <- sqlQuery(conn, paste("SELECT * FROM database"))
The BI error is as follows. Unfortunately in German but the codes should be the same I guess?
Details: "ADO.NET: R-Skriptfehler.
-- Attaching packages ------------------------------------------------------------------------------- tidyverse 1.3.0 --
v ggplot2 3.3.3 v purrr 0.3.4
v tibble 3.0.6 v dplyr 1.0.4
v tidyr 1.1.2 v stringr 1.4.0
v readr 1.4.0 v forcats 0.5.1
-- Conflicts ---------------------------------------------------------------------------------- tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
Attache Paket: 'lubridate'
The following objects are masked from 'package:base':
date, intersect, setdiff, union
Attache Paket: 'data.table'
The following objects are masked from 'package:lubridate':
hour, isoweek, mday, minute, month, quarter, second, wday, week,
yday, year
The following objects are masked from 'package:dplyr':
between, first, last
The following object is masked from 'package:purrr':
transpose
Warnmeldungen:
1: In RODBC::odbcDriverConnect("DSN=Xxx;UID=Xxx;PWD=Xxx") :
[RODBC] FEHLER: Status IM014, Code 0, Nachricht [Microsoft][ODBC Driver Manager] Der angegebene DSN weist eine nicht übereinstimmende Architektur von Treiber und Anwendung auf.
2: In RODBC::odbcDriverConnect("DSN=Xxx;UID=Xxx;PWD=Xxx") :
ODBC-Verbindung fehlgeschlagen
Fehler in sqlTables(conn) : erstes Argument ist kein offener RODBC-Kanal
Ausführung angehalten
"
I tried odbcDriverConnect with the the driver name as well, but also without success. Should I go further into the direction with odbcDriverConnect and try something else there? If anybody has an idea, I would be glad.
Thank you very much and best regards!