Skip to content

BUG in RODBC with OS X?

3 messages · Drew Balazs, Simon Urbanek

#
This is my second posting on this topic, the first recieved no
replies.  Has anyone successfully used RODBC on the OS X platform? 
I've tested the ODBC drivers I'm using with two other applications and
I've had no problems.  I begining to think the problem is with R/RODBC
and not the drivers.

Here are the specifics:

I'm having a problem connecting to an MS SQL Database via RODBC on OS
X. If I try to connect through the GUI using  chan <-
odbcConnect("drewdb", uid="user", pwd ="pwd") it simply crashes R with
the following crash report:

Date/Time:      2005-03-28 12:30:48 -0600
OS Version:     10.3.8 (Build 7U16)
Report Version: 2

Command: R
Path:    /Applications/R.app/Contents/MacOS/R
Version: 1.01 (1.01)
PID:     507
Thread:  0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x000001fc

However, if I try it through an xterm (command line), I get the following:

Warning messages:
1: [RODBC] ERROR: state IM004, code 0, message [iODBC][Driver
Manager]Driver's SQLAllocEnv() failed
2: ODBC connection failed in: odbcDriverConnect(st, case = case,
believeNRows = believeNRows)

I'm reasonably sure the DSN is okay because I can use it to connect to
the DB with other applications.
Any suggestions?

-Drew

Specific Info:
 Machine Model:        PowerBook5,6
 CPU Type:     PowerPC G4  (1.2)
 Number Of CPUs:       1
 CPU Speed:    1.67 GHz
 L2 Cache (per CPU):   512 KB
 Memory:       2 GB
 Bus Speed:    167 MHz
 System Version:       Mac OS X 10.3.8 (7U16)
 Kernel Version:       Darwin 7.8.0
 Boot Volume:  Macintosh HD

R : Copyright 2004, The R Foundation for Statistical Computing
Version 2.0.1  (2004-11-15), ISBN 3-900051-07-0
2 days later
#
Drew,
On Apr 8, 2005, at 11:53 AM, Drew Balazs wrote:

            
Yes - it works pretty much out of the box. I tested it with the  
Actual drivers and they work pretty well (although I don't have any  
MS box to test the MS SQL part of it).
Well, you didn't send the crash report, but only a small  
(unfortunately useless) part of it. Given the error below, chances  
are that the error is caused by the driver. As of the GUI, you should  
include the version (and possibly revision) of the GUI along with the  
full report so we can try to track it down. However, this won't help  
with the ODBC problem you have.
If you think this is not a driver problem, you should consider  
contacting the package maintainer, although I don't give it much hope  
as most ODBC problems are driver-related (and most drivers have very  
little OS X support). Alternatively you could ask on the  iODBC pages.

Cheers,
Simon
2 days later
#
Just for the record - this problem concerns Actual drivers for Mac OS  
X 10.3 (later OS X versions are not affected). The current temporary  
work-around is to install "iODBC Runtime" supplied with the Actual  
drivers and compile RODBC as follows (in bash assuming sufficient  
privileges):

LIBS='-framework iODBC' PKG_CFLAGS='-I/Library/Frameworks/ 
iODBC.framework/Headers' R CMD INSTALL RODBC_1.1-3.tar.gz

Simon