Maciej Hoffman-Wecker <Maciej.Hoffman-Wecker <at> bioskin.de> writes:

...
> But I succeeded in developing a tiny example, that reproduces the bug
(wherever it is).
> 
> I generated a small Access data base "test2.mdb" with one table "Tab1" and
following columns:
..... 

> > library(RODBC)
> > .con <- odbcConnectAccess("./test2.mdb")
> > (.d <- try(sqlQuery(.con, "select * from Tab1")))

> > (.d <- try(sqlQuery(.con, "select F1 , NO , F2 from Tab1")))
>   F1 Expr1001 F2
> 1  1        0  1
> 2  2        0  2
> 3  0        0  1
> 4  1        0  0
> > close(.con)

NO is a reserved word in ODBC (or where...). Whenever you see Exprxxx in
columns, put the column name in []
d <- try(sqlQuery(con, "select F1 ,[NO], F2 from Tab1"))

works for me.

Dieter

______________________________________________
R-help@stat.math.ethz.ch 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.

Reply via email to