Autoloading data from ODBC

110 views
Skip to first unread message

Fco. Javier Molinero Velasco

unread,
Jul 15, 2013, 8:28:15 AM7/15/13
to project...@googlegroups.com
I am trying to load data from an ODBC data source but I get the following error:

> load.project()
Loading project configuration
Autoloading helper functions
 Running helper script: helpers.R
Autoloading data
 Loading data set: energy
Error in sqlQuery(connection, database.info[["query"]]) : 
  first argument is not an open RODBC channel
In addition: Warning messages:
1: In odbcDriverConnect(connection.string) :
  [RODBC] ERROR: state IM002, code 0, message [Microsoft][Administrador de controladores ODBC] No se encuentra el nombre del origen de datos y no se especificó ningún controlador predeterminado
2: In odbcDriverConnect(connection.string) : ODBC connection failed

The spanish ERROR message says something like: "The data source name could not be found, and no predefined controller was specified".

I use this information in the sql file in the data directory:
type: odbc
user: hhp
password: hhp
host: mosis
dbname: Energy_mosis
table: building

where "Energy_mosis" is the data source name defined in my Windows 7.

I have tested the ODBC connection in R using:
odbcConnect("Energy_mosis", uid="hhp", pwd="hhp", case="nochange")
and it works well.

John Myles White

unread,
Jul 15, 2013, 9:44:33 AM7/15/13
to project...@googlegroups.com
I think you need to specify a DSN in your config file. This is what an ODBC config file should look like according to the source:

#' Example 7
#' type: odbc
#' dsn: sample_dsn
#' user: sample_user
#' password: sample_password
#' dbname: sample_database
#' query: SELECT * FROM sample_table

 -- John

--
You received this message because you are subscribed to the Google Groups "ProjectTemplate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projecttempla...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages