[R] puzzling RODBC error

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Mon Nov 26 14:37:25 CET 2012


Dear all,

I'm trying to connect to an MSAccess database (ArcGIS personal geodatabase). I keep getting an error about the channel when using sqlQuery(). However, sqlTables() does not complain about the channel and lists all tables in the database. If I try sqlFetch(), then R crashes.

I'm happy to hear suggestions on how to solve this.

Best regards,

Thierry

> MDB <- odbcConnectAccess("//inbodata/indata/Projects/PRJ_Watervogels/Geoloket/Telgebieden watervogeltellingen/Watervogellocaties_copy.mdb")
> sqlQuery(channnel = MDB, "SELECT gebiedscode FROM ganzengebieden;")
Error in sqlQuery(channnel = MDB, "SELECT gebiedscode FROM ganzengebieden;") :
  first argument is not an open RODBC channel
> sqlTables(channel = MDB) #truncated output!
   TABLE_SCHEM                    TABLE_NAME   TABLE_TYPE REMARKS
13        <NA>                ganzengebieden        TABLE    <NA>
> sqlFetch(channel = MDB, 'ganzengebieden') #makes R crash

> sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: i386-w64-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=Dutch_Belgium.1252  LC_CTYPE=Dutch_Belgium.1252
[3] LC_MONETARY=Dutch_Belgium.1252 LC_NUMERIC=C
[5] LC_TIME=Dutch_Belgium.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] RODBC_1.3-6

loaded via a namespace (and not attached):
[1] tools_2.15.2


ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Thierry.Onkelinx op inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey


* * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * *
Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document.
The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document.



More information about the R-help mailing list