## Not run: ------------------------------------
# # First run the command below from Powershell:
# # Read-Host "PW?" -AsSecureString | ConvertFrom-SecureString | Out-File "C:\Temp\Password.txt"
# # Now execute the following R commands to decrypt the password and save it in
# # variable "x". Note that if run without assignment, the password will not
# # be displayed in the console. Passwords must be saved to a variable or used
# # inline within a connection string.
# library("keyringr")
# x <- decrypt_dpapi_pw("C:\\Temp\\Password.txt")
#
# # function is best used in a connection string command:
# ch <- odbcConnect("some dsn", uid = "user1", pwd = decrypt_dpapi_pw("C:\\Temp\\Password.txt"))
## ---------------------------------------------
Run the code above in your browser using DataLab