Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I'm trying to run an R script in Power BI which connects to multiple sources and then runs a GLM to return predictions in a new dataframe. Im struggling with debugging some of the errors im getting.
The latest one is "Error in sqlQuery - first argument is not an open RODBC channel"
I have connected to the server initially in script:
con <- DBI::dbConnect(odbc::odbc(),
Driver = "{MySQL ODBC 8.0 ANSI Driver}",
Server = "server name",
UID ="username",
Database = "database",
PWD = "password",
Port = 3306)
I have then used the following at the start of the SQL query:
dataframe_name <- sqlQuery (con,
"SELECT.....
Any ideas why im getting this error?
Thanks
Update: ive now got the above working by moving to dbGetQuery, which is working for my first query. However the second query is giving me the error "Unable to translate bytes [A3] at index -1 from specified code page to Unicode." I've had a look online and cant see much for this error, any ideas?
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 42 | |
| 40 | |
| 21 | |
| 20 |
| User | Count |
|---|---|
| 142 | |
| 105 | |
| 63 | |
| 36 | |
| 35 |