[R] RODBC: how to set the data-source?
Oliver Bandel
oliver at first.in-berlin.de
Fri Aug 28 21:22:11 CEST 2009
Hi,
in
/usr/share/doc/r-cran-rodbc/README.gz
I found this example:
==============
[testpg]
Description = testpg
Driver = PostgreSQL
Trace = No
TraceFile =
ServerName = localhost
UserName = ripley
Port = 5432
Socket =
Database = testdb
ReadOnly = 0
==============
I changed it for me to:
==============
[rtest]
Description = rtest
Driver = PostgreSQL
Trace = No
TraceFile =
ServerName = localhost
UserName = oliver
Port = 5432
Socket =
Database = rtest
ReadOnly = 0
==============
With your hint on the Driver-value:
==============
[rtest]
Description = rtest
Driver = /usr/lib/odbc/libodbcpsqlS.so
Trace = No
TraceFile =
ServerName = localhost
UserName = oliver
Port = 5432
Socket =
Database = rtest
ReadOnly = 0
==============
Maybe I should give different names for the section and the database?!
==============
[rtestdb]
Description = rtest
Driver = /usr/lib/odbc/libodbcpsqlS.so
Trace = No
TraceFile =
ServerName = localhost
UserName = oliver
Port = 5432
Socket =
Database = rtest
ReadOnly = 0
==============
x > channel <- odbcConnect("rtestdb", "rtest")
x Warning messages:
x 1: In odbcDriverConnect(st, ...) :
x [RODBC] ERROR: state IM004, code 0, message [unixODBC][Driver x
x Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed
x 2: In odbcDriverConnect(st, ...) : ODBC connection failed
So this is not working correctly.
Here my settings for the ENV-vars:
oliver at siouxsie:~$ echo $ODBCINI
/etc/odbc.ini
oliver at siouxsie:~$ echo $ODBCSYSINI
/etc/
oliver at siouxsie:~$ echo $LD_LIBRARY_PATH
/usr/lib/odbc/libodbcpsqlS.so
oliver at siouxsie:~$
I have no clue what's the problem now.
Oliver
More information about the R-help
mailing list