RODBC functions and errors/warnings
问题 A question about this R code: library(RODBC) ch <- tryCatch(odbcConnect("RTEST"), warning=function(w){print("FAIL! (warning)");return(NA)}, error=function(e){print(paste("ERROR:",geterrmessage()));return(NA)}) df <- tryCatch(sqlQuery(ch,"SELECT Test from tblTest"), warning=function(w){print("FAIL! (warning)");return(NA)}, error=function(e){print(paste("ERROR:",geterrmessage()));return(NA)}) odbcClose(ch) Code works fine for errors (forced by omitting the required paramaters in the code) in