[R] RODBC

Shawn Way sway at tanox.com
Tue Nov 13 21:30:21 CET 2001


I'm tryuing to get the RODBC package to work with a MS Sql database
(Wonderware's InSQL).  I'm able to connect to the database using the
following:

version
         _                           
platform i386-pc-mingw32             
arch     x86                         
os       Win32                       
system   x86, Win32                  
status   Under development (unstable)
major    1                           
minor    4.0                         
year     2001                        
month    10                          
day      29                          
language R                           
> library(RODBC)
library(RODBC)

> channel <- odbcConnect("SCADA2","ways1","LO&B*O",case="msaccess")
> channel
channel
[1] 0

And an abreviated table list is:

...
25    Runtime                dbo                   AnalogHistory
TABLE
...

When I try to query the table, I get:

> test <- sqlQuery(channel,"select datetime, value from analoghistory where
tagname = 'a055-re-0020_ph_pv_flt' and datetime >= 'nov 1, 2001 2:00pm'")

> test
test
[1] "37000 201 [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure
'sp_prepare' expects parameter '@stmt', which was not supplied."
[2] "[RODBC]ERROR: Could not SQLPrepare"                           

Any thoughts?                                                    

Shawn Way
Tanox, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20011113/74d57dd0/attachment.html


More information about the R-help mailing list