[R] RODBC - problems using odbcDriverConnect without DSN

Josiah Walker merlz42 at gmail.com
Mon Jul 21 04:35:50 CEST 2008


Hi,

I'm trying to use RODBC without having to set up a DSN, using hte
direct connection string in odbcDriverConnect.  My connection attempt
looks something like:
> odbcDriverConnect(connection = "SERVER=localhost;DRIVER={/usr/lib/odbc/libmyodbc.so};DATABASE=myDB;UID=reader;PASSWORD=insecure;")

And this returns the message:
Warning messages:
1: In odbcDriverConnect(connection = conn) :
  [RODBC] ERROR: state IM002, code 0, message [unixODBC][Driver
Manager]Data source name not found, and no default driver specified
2: In odbcDriverConnect(connection = conn) : ODBC connection failed

I know this means it can't find x connection in the dsn... which means
my connection string isn't recognised as valid.  I've used ODBC and
ODBC connection strings before, but I can't work out why this wouldn't
work here.  I can successfully create the same connection using a user
DSN with the same settings as this, but this connection string won't
work.  It's fairly important for this project that the code can
connect without a DSN needing to be set on every computer that runs
it.  Does anyone know if I'm missing something in my connection
string, or can this not be done using RODBC?

Thanks,
Josiah.



More information about the R-help mailing list