Re: [R] RODBC for 64-bit R with 32-bit Access

2012-02-17 Thread GreatDana
This was my experience connecting remotely to an Oracle database with R 64
bit on Windows 7 64-bit. I already had a configuration for 32-bit R and
32-bit Oracle using RODBC that worked, but I wanted to only use R-64. Here
was what I did that works:

This was assuming an install to the root c:\ and windows in c:\windows

Download and install (I did full administrator install):
Oracle Client (x64) 11.2  ...
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-win64soft-094461.html
(I called Orahome2)

Open Oracle Net Manager in new installation (OraHome2)

Go to Service Naming, should be empty, go to Edit, and Create

Name connection name something different from the 32-bit version
host name : the domain name or IP address
Service name must still be the same as the 32-bit as before
Keep default port 1521

Next go to
C:\windows\system32\odbc32.exe (Oddly this is the 64-bit version)
Run this and set up a new system DSN connection
Call this whatever, but TNS Service ID must be the same as your connection
named above
Hit Test connection, should work.

When running in R-64 bit RODBC package:

I had to use the optional
odbcConnect(“databasename”,uid=””,pass=””,believeNRows=FALSE)

This worked for me!
Cheers,
Dana


--
View this message in context: 
http://r.789695.n4.nabble.com/RODBC-for-64-bit-R-with-32-bit-Access-tp3093030p4398497.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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.


[R] RODBC for 64-bit R with 32-bit Access

2010-12-17 Thread Alexander Shenkin
Hello Folks,

I do hope this is the correct place to post (and not in R-SIG-DB).  I have
spent the better part of a day searching for an answer to this question, and
have yet to resolve it.

I am trying to query an .accdb Access database (with 32-bit Office 2007
currently residing on the machine) with 64-bit R via RODBC.  There seem to
be some conflicting accounts as to whether or not this is possible.
Ripley's ODBC Connectivity PDF and the odbcConnect docs indicate it is not
possible (copied below for reference).  However, this thread (
http://r.789695.n4.nabble.com/RODBC-Access-Excel-driver-location-for-64-bit-Win7-td2542550.html)
seems to indicate that it may be possible by using
c:\windows\sysWOW64\odbcad32.exe:
For 64-bit WIn 7, I needed to use the ODBC in
c:\windows\sysWOW64\odbcad32.exe. I configured RODBC in the 'usual' way for
the 64-bit ODBC (i.e., per the R Import/Export manual) and everything is
fine.

I have tried creating DSN's using c:\windows\sysWOW64\odbcad32.exe and
referencing those with RODBC, but I come up with errors:

 library(RODBC);
 channel - odbcConnect(myDSN);
Warning messages:
1: In odbcDriverConnect(DSN=myDSN) :
  [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=myDSN) : ODBC connection failed

If anyone knows any more about this issue, I would be grateful for the
information!

Thanks,
Allie

R 2.12.0
Windows 7 Pro x64
Access 2007


from Ripley's ODBC Connectivity
32-bit Windows drivers for Access 2007 and Excel 2007 are bundled with
Office 2007 but can be installed separately via the installer
AccessDatabaseEngine.exe available from  The Access/Excel 2010 versions
at ... have a 64-bit version: however the 64-bit drivers cannot be installed
alongside 32-bit versions of Office (as far as we know, and defnitely not
for Office 2007).

odbcConnect docs:
You must have the 32-bit drivers when using 32-bit R and the 64-bit drivers
when using 64-bit R: otherwise there will be a cryptic message about a
driver not being found. And the 64-bit drivers cannot be installed alongside
32-bit Microsoft Office, and vice versa.

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] RODBC for 64-bit R with 32-bit Access

2010-12-17 Thread Dennis Murphy
Hi:

Since I'm the culprit of that post, is your Access database on your 64-bit
machine or is it on a remote server? In my case, I have 32-bit MySQL on a
64-bit Win7 system and I've used RODBC several times to upload a file to R,
but it was to 32-bit R (I just checked to be sure). It doesn't work on
64-bit R.  [See below for the transcript.]

The comments in the post to which you referred concerned how to set up ODBC
on a 64-bit system when one had a 32-bit database and 32-bit R. To access
the right ODBC for that setup, you have to grab it from the directory
mentioned in the post. As mentioned there, I put a shortcut to it on my
desktop so I don't have to go on a fishing expedition to find it again. As
far as I can tell, there has to be coordination among R, the database and
ODBC in the sense that they all must be 32-bit or all 64-bit.

Since I don't use databases all that often, my dodge is to read the files in
with 32-bit R, save them as R binaries and then work with those in 64-bit R
- but I've got enough disk space and RAM to afford to do that. Your mileage
may vary.

64-bit R:
 library(RODBC)
 ch - odbcConnect('gameday10', uid = 'dennis', pwd = '')
Warning messages:
1: In odbcDriverConnect(DSN=gameday10;UID=dennis) :
  [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=gameday10;UID=dennis) :
  ODBC connection failed

32-bit R:
 library(RODBC)
 ch - odbcConnect('gameday10', uid = 'dennis', pwd = '')
 sqlTables(ch)
  TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS
1 gameday10  atbat  TABLE

Hope this clarifies matters somewhat.

Dennis

On Fri, Dec 17, 2010 at 11:48 AM, Alexander Shenkin ashen...@ufl.eduwrote:

 Hello Folks,

 I do hope this is the correct place to post (and not in R-SIG-DB).  I have
 spent the better part of a day searching for an answer to this question,
 and
 have yet to resolve it.

 I am trying to query an .accdb Access database (with 32-bit Office 2007
 currently residing on the machine) with 64-bit R via RODBC.  There seem to
 be some conflicting accounts as to whether or not this is possible.
 Ripley's ODBC Connectivity PDF and the odbcConnect docs indicate it is not
 possible (copied below for reference).  However, this thread (

 http://r.789695.n4.nabble.com/RODBC-Access-Excel-driver-location-for-64-bit-Win7-td2542550.html
 )
 seems to indicate that it may be possible by using
 c:\windows\sysWOW64\odbcad32.exe:
 For 64-bit WIn 7, I needed to use the ODBC in
 c:\windows\sysWOW64\odbcad32.exe. I configured RODBC in the 'usual' way for
 the 64-bit ODBC (i.e., per the R Import/Export manual) and everything is
 fine.

 I have tried creating DSN's using c:\windows\sysWOW64\odbcad32.exe and
 referencing those with RODBC, but I come up with errors:

  library(RODBC);
  channel - odbcConnect(myDSN);
 Warning messages:
 1: In odbcDriverConnect(DSN=myDSN) :
  [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=myDSN) : ODBC connection failed

 If anyone knows any more about this issue, I would be grateful for the
 information!

 Thanks,
 Allie

 R 2.12.0
 Windows 7 Pro x64
 Access 2007


 from Ripley's ODBC Connectivity
 32-bit Windows drivers for Access 2007 and Excel 2007 are bundled with
 Office 2007 but can be installed separately via the installer
 AccessDatabaseEngine.exe available from  The Access/Excel 2010 versions
 at ... have a 64-bit version: however the 64-bit drivers cannot be
 installed
 alongside 32-bit versions of Office (as far as we know, and defnitely not
 for Office 2007).

 odbcConnect docs:
 You must have the 32-bit drivers when using 32-bit R and the 64-bit
 drivers
 when using 64-bit R: otherwise there will be a cryptic message about a
 driver not being found. And the 64-bit drivers cannot be installed
 alongside
 32-bit Microsoft Office, and vice versa.

[[alternative HTML version deleted]]

 __
 R-help@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.


[[alternative HTML version deleted]]

__
R-help@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.