2

I am trying to use Osisoft's PI ODBC client. I am on a 64 bit Windows 7 machine. Because of some issues with 32 to 64 bit connecions, Osisoft came up with this workaround. After following the directions I was able to see the PI-ODBC driver in the ODBC Data Source Administrator and I was able to configure it. The problem is that when I open R and use the package RODBC I get an error. This is the code I used and the error it generated:

> library("RODBC", lib.loc="C:/Program Files/R/R-2.15.3/library")

ch <- odbcConnect("PIWHI")

Warning messages:
1: In odbcDriverConnect("DSN=PIWHI") :
  [RODBC] ERROR: state IM014, code 0, message [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
2: In odbcDriverConnect("DSN=PIWHI") : ODBC connection failed

I'm lost as to why this is not working. I know everything with setting up the ODBC client worked...a rep from OSIsoft confirmed this. I'm not sure why R isn't able to connect to it

codea
  • 1,439
  • 1
  • 17
  • 31
GK89
  • 646
  • 5
  • 29
  • So I think I know what is going on. On my 64 bit machine, I'm able to configure the ODBC driver as a 32 bit data source. However, when I try to configure as a 64 bit data source it gives me the error of architecture mismatch. My question now is how to I use RODBC to only connect to the 32 bit data source? – GK89 Aug 26 '13 at 15:25

1 Answers1

2

As it turns out the PI ODBC driver is a 32 bit driver. Because I was using a 64 bit version of R, a connection could not take place. I changed to a 32 bit version of R and it worked well.

GK89
  • 646
  • 5
  • 29
  • Aha. https://support.rstudio.com/hc/communities/public/questions/200656876-Changing-and-R-Installation-32-vs-64-bit-version- – EngrStudent Jan 21 '15 at 19:23