Shea EVANS Posted June 3, 2021 Share Posted June 3, 2021 I am trying tosend a dataframe into a local Access database. I have tested the code in Rstudio with no problems, but when I try as a Spotfire Data Function, I get the error: "Error in sqlTables(conn) : first argument is not an open RODBC channel. I have the connection stringset up correctly, and it works fine in RStudio. I have tried selecting "Force Local" under Edit Parameters, but that did not help. Here's the portion of the code that is causing me problems: conn = odbcDriverConnect("Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=") WHcolumnTypes = list(API_NUMBER_10 = "VARCHAR(10)", Well_Name = "VARCHAR(50)", OPERATOR = "VARCHAR(50)", ARIES_RESERVOIR = "VARCHAR(50)") if ("WELL_INFO" %in% sqlTables(conn)$TABLE_NAME){ sqlDrop(conn, "WELL_INFO",errors = TRUE)} sqlSave(conn, WH, tablename = "WELL_INFO", append = FALSE, varTypes=WHcolumnTypes) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now