[R] Error in sqlCopy in RODBC

Dieter Menne dieter.menne at menne-biomed.de
Thu Nov 27 09:20:54 CET 2008

BKMooney wrote:
> I tried your suggestion...
> library(RODBC)
> channel = odbcConnectAccess("db.mdb")
> sqlCopy(channel,"Select * from tab","newtab",destchannel=channel,
>   safer=TRUE,append=TRUE,rownames=FALSE,fast=FALSE)
> odbcClose(channel)
> however, I am still running into errors, both when appending to an
> existing table, or creating a table if the destination table does not
> exist.  
> The code I am using is: 
> query <-  " select * from tblHistorical where MyDate between '2008-11-21'
> and '2008-11-25' ; "
> sqlCopy(RemoteChannel, query, "NewTable", destchannel=LocalChannel,
> safer=TRUE, append=TRUE, rownames=FALSE, fast=FALSE)

This is confusing: did you get an error trying my code, or did you get an
error with your
code? RODBC is very context dependent, and chances are close to zero that
you get
a useful reply when you do not provide an example or even not run the
example provided
in your environment.

Did you try the select statement directly in a query? '2008-11-25' or


View this message in context: http://www.nabble.com/Error-in-sqlCopy-in-RODBC-tp20691929p20715135.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list