[R] How to run R-script from remote VB program

Tae Sik Han eliothan at yahoo.com
Wed Feb 2 21:52:48 CET 2005


I have installed D COM server1.35 and can send a line
of R code and get a result from my VB (.net) program.

So I located all the  R commands in a file ("a.R") in
the dir path ("c:\") then call VB using source as
below.

Dim RLink As StatConnector
RLink = New StatConnector  
RLink.Init("R")

dim str
str = "source(" + """" + "c:\a.R" + """" + ")"
RLink.EvaluateNoReturn(str)


I got an error message  :
An unhandled exception of type
'System.Runtime.InteropServices.COMException' occurred
in MY_VB.exe
Additional information: Object is static; operation
not allowed

"a.R" has codes to load RODBC package and collecting
and running query result to the Oracle DB.

How can I run the R-code script remotely from VB
program ?

I appreciate your help.

Regards,

Tae Sik Han.




More information about the R-help mailing list