Questions tagged [rodbc]

RODBC provides an ODBC database interface for R. The CRAN package provides access to any Open DataBase Connectivity (ODBC) accessible database.

RODBC is an package providing an interface to database sources supporting an ODBC interface. This is very widely available, and allows the same R code to access different database systems. RODBC runs on /, and , and almost all database systems provide support for . The supported systems include , , , , and .

Repositories

Vignettes

Other resources

Related tags

802 questions
62
votes
5 answers

SQL Server RODBC Connection

Does anyone have a connection string example for using RODBC and connecting to MS SQL Server 2005 or 2008. Thank you.
Brandon
  • 1,036
  • 2
  • 17
  • 19
56
votes
8 answers

How to connect R with Access database in 64-bit Window?

When I tried to connect R with Access database I get an error odbcConnectAccess is only usable with 32-bit Windows Does anyone has an idea how to solve this? library(RODBC) mdbConnect<-odbcConnectAccess("D:/SampleDB1/sampleDB1.mdb")
Chris
  • 1,248
  • 4
  • 17
  • 25
26
votes
2 answers

RODBC Temporary Table Issue when connecting to MS SQL Server

I am running R on unix and I am using the RODBC package to connect to MS SQL server. I can execute a query that returns results fine with the package, but if I use a temporary table somewhere in my SQL query, an empty string is returned to me. …
rlh2
  • 1,039
  • 2
  • 9
  • 16
24
votes
4 answers

How to stop a running query?

I use RODBC to send queries to an SQL-Server. Sometimes they take too much time to run, so I need to cancel them. Clicking the red "stop" button in RStudio yields this error message: R is not responding to your request to interrupt processing so to…
Scarabee
  • 5,437
  • 5
  • 29
  • 55
24
votes
3 answers

How to insert a dataframe into a SQL Server table?

I'm trying to upload a dataframe to a SQL Server table, I tried breaking it down to a simple SQL query string.. library(RODBC) con <- odbcDriverConnect("driver=SQL Server; server=database") df <- data.frame(a=1:10, b=10:1, c=11:20) values <-…
jenswirf
  • 7,087
  • 11
  • 45
  • 65
23
votes
4 answers

Pass R variable to RODBC's sqlQuery?

Is there any way to pass a variable defined within R to the sqlQuery function within the RODBC package? Specifically, I need to pass such a variable to either a scalar/table-valued function, a stored procedure, and/or perhaps the WHERE clause of a…
Ray
  • 3,137
  • 8
  • 32
  • 59
22
votes
4 answers

RODBC odbcDriverConnect() Connection Error

I'm trying to use odbcDriverConnect('driver={SQL Server};server=servername\instancename,port;database=testing;username=abc;password=123456') to connect remote database server (sql server 2008). But I got [RODBC] ERROR: state 08001, code 17,…
lijie98
  • 617
  • 1
  • 6
  • 13
21
votes
5 answers

RODBC queries returning zero rows

Issue: RODBC (falsely) returning zero rows Situation: I'm using RODBC to connect to a DSN I created using a commercial DB's ODBC driver (OSI Soft's PI Historian Time Series DB, if you're curious). > library(RODBC) > piconn <- odbcConnect("PIRV",…
Tommy O'Dell
  • 7,019
  • 13
  • 56
  • 69
20
votes
4 answers

Installation of RODBC/ROracle packages on OS X Mavericks

I have been trying to install some packages such as RODBC, ROracle or RGtk2 - used for rattle. I would really appreciate it if someone could help me get around this problem so that I could use these applications on a Mac with mavericks and with…
runningbirds
  • 6,235
  • 13
  • 55
  • 94
20
votes
8 answers

Failure to connect to odbc database in R

I've been trying to connect my company's DMS to R using the odbcConnect command, but get the following message: myConn <-odbcConnect("NZSQL", uid="cejacobson", pwd="password") Warning messages: 1: In…
cjacobso
  • 389
  • 2
  • 4
  • 12
18
votes
2 answers

R: Painfully slow read performance using RODBC & SQL Server

I am new to R but am interested in using Shiny to create dynamic charts using data stored in a SQL Server database. To enable interactivity, I want to bring in the raw data from the database and perform calculations within R rather than have the…
Jayhawk
  • 183
  • 1
  • 1
  • 6
17
votes
4 answers

RODBC not recognizing my odbc settings

I'm running R 2.15.2 on a Red Hat Linux 6 server. My goal is to connect to a MS SQL Server Database on another machine via RODBC. I did my research and downloaded and installed the linux version of the MS SQL ODBC driver from the microsoft support…
vergilcw
  • 2,093
  • 4
  • 16
  • 20
16
votes
3 answers

How to pass data.frame for UPDATE with R DBI

With RODBC, there were functions like sqlUpdate(channel, dat, ...) that allowed you pass dat = data.frame(...) instead of having to construct your own SQL string. However, with R's DBI, all I see are functions like dbSendQuery(conn, statement, ...)…
mchen
  • 9,808
  • 17
  • 72
  • 125
15
votes
8 answers

RODBC loses time values of datetime when result set is large

So this is VERY strange. RODBC seems to drop the time portion of DateTime SQL columns if the result set is large enough. (The queries are running against an SQL Server 2012 machine, and, yes, when I run them on the SQL Server side they produce…
jbeldock
  • 2,755
  • 3
  • 18
  • 31
15
votes
1 answer

closing unused RODBC handle

I have been receiving a Warning Message: `historicalHourly <- importHistoricalHourly(startDatePast,endDatePast,Markets,location) [1] "Importing Hourly Data" [1] "Flag - Moving from importHistoricalHourly to CleaningUpHourly" [1] "Flag - Moving to…
user2480137
  • 171
  • 1
  • 1
  • 4
1
2 3
53 54