[R] odbcConnectAccess function

Felipe Carrillo mazatlanmexico at yahoo.com
Thu Apr 30 22:06:39 CEST 2009


Steve: I am already using it importing data from Access to R but was wondering if it can be used the other way around, creating a subroutine in an access module and using the RODBC functions from there.



--- On Thu, 4/30/09, Steve_Friedman at nps.gov <Steve_Friedman at nps.gov> wrote:

> From: Steve_Friedman at nps.gov <Steve_Friedman at nps.gov>
> Subject: Re: [R] odbcConnectAccess function
> To: mazatlanmexico at yahoo.com
> Cc: r-help at stat.math.ethz.ch, r-help-bounces at r-project.org
> Date: Thursday, April 30, 2009, 7:38 AM
> 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