Hello, I'm using R 2.2.0 on a Mac and attempting to use the RODBC package to connect to a PostgreSQL server on the local network. I can't tell whether my problem is in R, or in ODBC setup. I got drivers from OpenLink, created a dsn and tested it using the iODBC application. then I load the RODBC package, use this code and get the following error. I tried with both the odbcConnect util and the odbcDriverConnect util. I am able to connect to the database through other non-odbc based database programs from the Mac, so I know it's not a Postgres setting (like no tcp/ip connections or something). > library(RODBC) > channel <- odbcConnect("nfl",uid="postgres", pwd="xxx") Warning messages: 1: [RODBC] ERROR: Could not SQLDriverConnect 2: ODBC connection failed in: odbcDriverConnect(st, case = case, believeNRows = believeNRows) > > channel2 <- odbcDriverConnect(connection="DSN=nfl, UID=postgres, PWD=vladdy79" ) Warning messages: 1: [RODBC] ERROR: state IM002, code 0, message [iODBC][Driver Manager] Data source name not found and no default driver specified. Driver could not be loaded 2: ODBC connection failed in: odbcDriverConnect(connection = "DSN=nfl, UID=postgres, PWD=xxx") Does anyone have any suggestions? Thanks, Michael Greene
On Sat, 29 Oct 2005, Michael Greene wrote:> > Hello, > > I'm using R 2.2.0 on a Mac and attempting to use the RODBC package to > connect to a PostgreSQL server on the local network. I can't tell > whether my problem is in R, or in ODBC setup.These are ODBC error reports, so the problem is in ODBC.> I got drivers from OpenLink, created a dsn and tested it using the > iODBC application. then I load the RODBC package, use this code and > get the following error. I tried with both the odbcConnect util and > the odbcDriverConnect util. I am able to connect to the database > through other non-odbc based database programs from the Mac, so I > know it's not a Postgres setting (like no tcp/ip connections or > something).No, you don't. I've see quite a few problems which were Postgresql (sic) settings affecting the ODBC driver.> > library(RODBC) > > channel <- odbcConnect("nfl",uid="postgres", pwd="xxx") > Warning messages: > 1: [RODBC] ERROR: Could not SQLDriverConnect > 2: ODBC connection failed in: odbcDriverConnect(st, case = case, > believeNRows = believeNRows) > > > > channel2 <- odbcDriverConnect(connection="DSN=nfl, UID=postgres, > PWD=vladdy79" ) > Warning messages: > 1: [RODBC] ERROR: state IM002, code 0, message [iODBC][Driver Manager] > Data source name not found and no default driver specified. Driver > could not be loaded > 2: ODBC connection failed in: odbcDriverConnect(connection > "DSN=nfl, UID=postgres, PWD=xxx")-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Hi, I hope that someone can help me with the following problem with RODBC connection to a MySQL database I am running R version 2.2.0 on windows XP, and have the MySQL database registered in Windows ODBC. I have set up a web interface on my personal ISS web server using PhP to accept input values and then call Rterm with an R script to access the database and return a summary of the analysed data. This works perfectly if I run it from Rgui, or if I run Rterm from the dos prompt using the same command line arguments, but returns an RODBC error (below) when calling Rterm from the web interface 1: [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified There appears to be some problem with recognising the database when called from the web page, even though it is not a problem at any other times. Does anyone have any suggestions as to what I can do to overcome this error Thanks for your help cheers Evan Sergeant AusVet Animal Health Services 69 Turner Cr, Orange NSW 2800 Australia Phone +61 2 6362 1598 Fax +61 2 6369 1473 Email: evan at ausvet.com.au Web site: http://www.ausvet.com.au MLA's Q Fever Register: www.qfever.org This transmission is for the intended addressee only and is confidential information. If you have received this transmission in error, please delete it and notify the sender. The contents of this email are the opinion of the writer only a