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
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