Hi, useR- I am connecting to Oracle database using RODBC, but keep getting this error message:> library(RODBC) > channel <- odbcConnect(dsn="abc", uid="abc", pwd="abc", case='oracle')Warning in odbcDriverConnect(st, ...) : [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified Warning in odbcDriverConnect(st, ...) : ODBC connection failed Do you know what needs to be corrected? I am a beginner in DB. There was a post for the exact same message, but no one replied. Hope this time someone else help me! Thank you. -- View this message in context: http://www.nabble.com/connecting-to-Oracle-tp26031761p26031761.html Sent from the R help mailing list archive at Nabble.com.
On Oct 23, 2009, at 2:08 PM, whizvast wrote:> > Hi, useR- > > I am connecting to Oracle database using RODBC, but keep getting > this error > message: > >> library(RODBC) >> channel <- odbcConnect(dsn="abc", uid="abc", pwd="abc", >> case='oracle') > Warning in odbcDriverConnect(st, ...) : > [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver > Manager] Data source name not found and no default driver specified > Warning in odbcDriverConnect(st, ...) : ODBC connection failed > > Do you know what needs to be corrected? I am a beginner in DB. > There was a post for the exact same message, but no one replied. > Hope this time someone else help me! Thank you.The first place to start would be to read the RODBC vignette. You can do this by looking at the online version: http://cran.r-project.org/web/packages/RODBC/vignettes/RODBC.pdf or by using: library(RODBC) vignette("RODBC") It's been a while since I have used Windows, but at first glance it is likely going to be one of: You have not properly installed and configured the Oracle ODBC driver on your system You have not correctly specified a DSN for your Oracle server You are perhaps missing some required environment variables The vignette covers some of these issues in Appendix A. If you have access to a SysAdmin who is familiar with your Oracle server configuration, you may need technical assistance in order to get the various network and server settings that will be required. HTH, Marc Schwartz
I found an old Internet posting and it solved my problem. For those who is suffering from the same problem, try this: channel <- odbcDriverConnect(connection="Driver={Microsoft ODBC for Oracle};DSN=abc;UID=abc;PWD=abc", case = 'oracle') x <- sqlQuery(channel, paste("select * from db_name.tbl_name")) whizvast wrote:> > Hi, useR- > > I am connecting to Oracle database using RODBC, but keep getting this > error message: > >> library(RODBC) >> channel <- odbcConnect(dsn="abc", uid="abc", pwd="abc", case='oracle') > Warning in odbcDriverConnect(st, ...) : > [RODBC] ERROR: state IM002, code 0, message [Microsoft][ODBC Driver > Manager] Data source name not found and no default driver specified > Warning in odbcDriverConnect(st, ...) : ODBC connection failed > > Do you know what needs to be corrected? I am a beginner in DB. > There was a post for the exact same message, but no one replied. > Hope this time someone else help me! Thank you. > > >-- View this message in context: http://www.nabble.com/connecting-to-Oracle-tp26031761p26049795.html Sent from the R help mailing list archive at Nabble.com.