[R] odbcConnectAccess function
Steve_Friedman at nps.gov
Steve_Friedman at nps.gov
Thu Apr 30 16:38:17 CEST 2009
Feilipe,
You should look at the RODBC package
It works great !
Steve
Steve Friedman Ph. D.
Spatial Statistical Analyst
Everglades and Dry Tortugas National Park
950 N Krome Ave (3rd Floor)
Homestead, Florida 33034
Steve_Friedman at nps.gov
Office (305) 224 - 4282
Fax (305) 224 - 4147
Felipe Carrillo
<mazatlanmexico at y
ahoo.com> To
Sent by: r-help at stat.math.ethz.ch
r-help-bounces at r- cc
project.org
Subject
[R] odbcConnectAccess function
04/30/2009 07:17
AM MST
Please respond to
mazatlanmexico at ya
hoo.com
HI:
Is it possible to use the RODBC package within MS Access. I have been using
from R but was just wondering if it could be used along with R(D)COM.
Something like this:
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim myApp As StatConnector
Set myApp = New StatConnector
myApp.GetErrorText
myApp.Init "R"
myApp.EvaluateNoReturn "library(RODBC)"
myApp.EvaluateNoReturn "myDB <- odbcConnectAccess(CurrentDb)"
'query the database and save it as R object 'a'
myApp.EvaluateNoReturn "a <- sqlQuery(CurrentDb, Paste(""select * From
Sample""))"
myApp.EvaluateNoReturn "plot(a)"
Thanks in advance
Felipe D. Carrillo
Supervisory Fishery Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA
______________________________________________
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.
More information about the R-help
mailing list