Hi all, I would like the following code to work, but it doesn't: library(DBI) library(RODBC) m <- dbDriver("RODBC") # Example for dbConnect(DBI), causes error m <- dbDriver("ODBC") # Example for DBIDriver-class(DBI), causes error The errors are: Error in do.call(as.character(drvName), list(...)) : could not find function "RODBC" (substitute "ODBC" for "RODBC" to get the second error) I've successfully used RODBC without using the DBI interface, and I've successfully used the DBI interface with SQLite. Am I doing something wrong here or is DBI simply not implemented for ODBC? The latter seems unlikely considering the wide use of ODBC, but you never know. I hope it's just me doing something wrong. Best, Magnus [[alternative HTML version deleted]]
On 30 June 2008 at 08:57, Magnus Torfason wrote: | Hi all, I would like the following code to work, but it doesn't: | | library(DBI) | library(RODBC) | m <- dbDriver("RODBC") # Example for dbConnect(DBI), causes error | m <- dbDriver("ODBC") # Example for DBIDriver-class(DBI), causes error | | The errors are: | Error in do.call(as.character(drvName), list(...)) : | could not find function "RODBC" | (substitute "ODBC" for "RODBC" to get the second error) | | I've successfully used RODBC without using the DBI interface, and I've | successfully used the DBI interface with SQLite. | | Am I doing something wrong here or is DBI simply not implemented for ODBC? Yes and yes ;-) If you use DBI, you need to use one of the supported backends. As of right now, those are MySQL, SQLite, Oracle. I am mentoring a student in the 'Google Summer of Code' project going right who is adding PostgreSQL to the list; this is progressing well. Nobody has 'connected' DBI and ODBC. By the way, there is a mailing list r-sig-db for database discussions related to R. Dirk -- Three out of two people have difficulties with fractions.
On Mon, 30 Jun 2008, Magnus Torfason wrote:> Hi all, I would like the following code to work, but it doesn't: > > library(DBI) > library(RODBC) > m <- dbDriver("RODBC") # Example for dbConnect(DBI), causes error > m <- dbDriver("ODBC") # Example for DBIDriver-class(DBI), causes error > > The errors are: > Error in do.call(as.character(drvName), list(...)) : > could not find function "RODBC" > (substitute "ODBC" for "RODBC" to get the second error) > > I've successfully used RODBC without using the DBI interface, and I've > successfully used the DBI interface with SQLite. > > Am I doing something wrong here or is DBI simply not implemented for ODBC? > The latter seems unlikely considering the wide use of ODBC, but you never > know. I hope it's just me doing something wrong'DBI simply not implemented for ODBC' has value TRUE. You would do better to ask such questions on R-sig-db.> > Best, > Magnus > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595