Skip to content
Prev 178943 / 398503 Next

odbcConnectAccess function

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