rodbc

RODBC fails: “invalid character value for cast specification” - Excel 2007

孤街醉人 提交于 2021-01-27 03:53:56
问题 I'm trying to use RODBC to write to an Excel2007 file and I keep getting errors. I've reduced the issue to this very basic case, a 1-row data.frame with character, numeric, Date, and logical datatypes: toWrite = data.frame( Name = "joe" , Date = as.Date("2011-01-01"), Value = 2 , Paid = FALSE ) xlFile = odbcConnectExcel2007( "REPLACE_WITH_XLSB_FILE_PATH" , readOnly = FALSE ) sqlSave( xlFile , toWrite , tablename = "worksheet1" , rownames = FALSE ) The error: Error in sqlSave(xlFile, toWrite,

RODBC fails: “invalid character value for cast specification” - Excel 2007

坚强是说给别人听的谎言 提交于 2021-01-27 03:53:54
问题 I'm trying to use RODBC to write to an Excel2007 file and I keep getting errors. I've reduced the issue to this very basic case, a 1-row data.frame with character, numeric, Date, and logical datatypes: toWrite = data.frame( Name = "joe" , Date = as.Date("2011-01-01"), Value = 2 , Paid = FALSE ) xlFile = odbcConnectExcel2007( "REPLACE_WITH_XLSB_FILE_PATH" , readOnly = FALSE ) sqlSave( xlFile , toWrite , tablename = "worksheet1" , rownames = FALSE ) The error: Error in sqlSave(xlFile, toWrite,

Open .ODC connection in R

陌路散爱 提交于 2020-06-26 07:58:30
问题 I have an .odc (office data connection) that connects Excel to a Web Service (MSBI, Web PowerBI). It's working fine. I open the odc file, Excel opens up and it is connected to the data source. How can I open this connection directly from R? The odc file contents are: <odc:ConnectionString> Provider=MSOLAP; Integrated Security=ClaimsToken; Identity Provider=https://login.microsoftonline.com/common, https://analysis.windows.net/powerbi/api, xxxxxx-xx-xx-xxxxxx; Data Source=pbiazure://api

ODBC connection string and/or DSN in R

有些话、适合烂在心里 提交于 2020-04-16 02:57:05
问题 I'm trying to connect to and read many hundreds of MS Access database files using the "RODBC" package in RStudio (32 bit). The previous program used to open and read these files used and system.mdw system database file to specify user permissions, but I can't find anything in the RODBC documentation that describes how to include this file in the connection string. Here is what I've tried, which has succceded in connecting to the database, but failed to read any of the contents: files <- dir(

First argument is not an open RODBC channel

若如初见. 提交于 2020-02-24 18:58:54
问题 I am connecting to an Oracle database via DNS (set up the connection on the tnsnames.ora with the name "database"). I am able to succesfully run the following code: con <- DBI::dbConnect(odbc::odbc(), "database", UID = "user", PWD = "password", trusted_connection = TRUE) I am also able to succesfully list all the tables in the database via: list <- dbListTables(con) View(list) However, when I run: results <- sqlQuery(channel = con, query = "select * from myschemaname.table") I get the error:

First argument is not an open RODBC channel

会有一股神秘感。 提交于 2020-02-24 18:58:26
问题 I am connecting to an Oracle database via DNS (set up the connection on the tnsnames.ora with the name "database"). I am able to succesfully run the following code: con <- DBI::dbConnect(odbc::odbc(), "database", UID = "user", PWD = "password", trusted_connection = TRUE) I am also able to succesfully list all the tables in the database via: list <- dbListTables(con) View(list) However, when I run: results <- sqlQuery(channel = con, query = "select * from myschemaname.table") I get the error:

First argument is not an open RODBC channel

扶醉桌前 提交于 2020-02-24 18:58:12
问题 I am connecting to an Oracle database via DNS (set up the connection on the tnsnames.ora with the name "database"). I am able to succesfully run the following code: con <- DBI::dbConnect(odbc::odbc(), "database", UID = "user", PWD = "password", trusted_connection = TRUE) I am also able to succesfully list all the tables in the database via: list <- dbListTables(con) View(list) However, when I run: results <- sqlQuery(channel = con, query = "select * from myschemaname.table") I get the error:

RODBC and Access - Loading data

对着背影说爱祢 提交于 2020-01-29 18:19:11
问题 I am trying to load some data into R from an Access database. All of the instructions I can find say to use odbcConnectAccess("file.mdb") but I cannot seem to load this function. Has it been replaced or renamed? Is there another way to do this? I've loaded RODBC with library("RODBC") but still have no luck. Thank you! 回答1: If you're using on a Mac, I've found success using Actual Technologies drivers to connect to Access databases. If you've already set up the ODBC connection, using ODBC

Why will WHERE statement not work in sqlQuery in RODBC?

。_饼干妹妹 提交于 2020-01-25 08:04:49
问题 We keep all our laboratory data in a Sybase database. When I want to do data manipulation and analysis I read the data into R with RODBC. library(RODBC) channellab <- odbcConnect("Labdata") indivs <-sqlQuery(channellab,'SELECT * from CGS.Specimen') So far so good, except that CGS.Specimen is a table for our entire lab holdings. There are almost 40000 specimens (rows) with 66 variables. It takes an unnecessary amount of time to read especially when I am only interested in the holdings of one