## Not run:
# library(REDCapR) #Load the package into the current R session.
#
# ##
# ## Rely on `retrieve_token()` to create & destory the channel.
# ##
# dsn <- "TokenSecurity"
# project <- "DiabetesSurveyProject"
# token <- retrieve_token(dsn=dsn, project_name=project)
#
# ##
# ## Create & close the channel yourself, to optimize repeated calls.
# ##
# dsn <- "TokenSecurity"
# project1 <- "DiabetesSurveyProject1"
# project2 <- "DiabetesSurveyProject2"
# project3 <- "DiabetesSurveyProject3"
#
# channel <- RODBC::odbcConnect(dsn=dsn)
# token1 <- retrieve_token(dsn=dsn, project_name=project1)
# token2 <- retrieve_token(dsn=dsn, project_name=project2)
# token3 <- retrieve_token(dsn=dsn, project_name=project3)
# RODBC::odbcClose(channel)
# ## End(Not run)
Run the code above in your browser using DataLab