David Scott-6 wrote: > > I have been trying to read some data from an Excel workbook without > success. > ... > > faults <- sqlFetch(channel, sqtable = 'Data', > + colnames = FALSE, as.is = TRUE) > > faults > [1] "HY001 -1040 [Microsoft][ODBC Excel Driver] Too many fields defined." > [2] "[RODBC] ERROR: Could not SQLExecDirect 'SELECT * FROM [Data$]'" > >
I have given up using odbc/Excel without named ranges, but I know it works sometimes. xlsReadWrite works well for whole sheets, while the gdata/Perl solutions can be terribly slow (minutes instead of seconds) with large files. I had seen the message above before, and it had to do with some invisible characters in the fields. I managed to get it to work by exporting value of the sheet, which seems to do a cleanup. Alternatively, a Copy/PasteValue. After that, my curiosity was satisfied, and I returned to named ranges or xlsReadWrite. Dieter -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-RODBC-tp3680047p3680108.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.