I want to mask my password and username from my script. There are examples of how to do this, e.g. here: https://db.rstudio.com/best-practices/managing-credentials/
However, I can't get this to work with my script set-up.
Tried to use keyring but can't get it to work.
conn <- odbcDriverConnect("Driver=ODBC Driver 13 for SQL Server;
server=XXX,1433;
database=XXX;
uid=Needtohide;
pwd=Needtohide")
This code connects me to my DB. I have to use RODBC otherwise SQL tables won't pull back due to data ordering. I want to modify my script to hide the username or at least the password please. Thanks
I get a cannot connect error with
conn <- odbcDriverConnect("Driver=ODBC Driver 13 for SQL Server; server=XXX,1433; database=XXX; uid=myuserID; pwd=key_get('DB', 'myuserID')")
The main problem with all the solutions is that RODBC uses a connection STRING and so how to put an additional function into that.