BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
milts
Pyrite | Level 9

I'm having trouble connecting to a SQL Server 2016 DB when the string password is encoded.

 

This works.

libname test2 odbc noprompt="server=SRV;Driver=SQL Server;uid=sa;pwd=mypwd;database=DB";

 

But this doesn't work.

libname test2 odbc noprompt="server=SRV;Driver=SQL Server;uid=sa;pwd='{SASENC}12345F';database=DB";

 

Appreciate any help. Thank you very much!

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star

What's your error message?

 

There's an old SAS Note that says you can't use encrypted passwords in connection strings:

 

http://support.sas.com/kb/31/602.html

 

Don't know if it is still the case or not. Maybe you could try moving the user and password outside of NOPROMPT in separate parameters as encryption in the PASSWORD parameter is allowed.

View solution in original post

2 REPLIES 2
SASKiwi
PROC Star

What's your error message?

 

There's an old SAS Note that says you can't use encrypted passwords in connection strings:

 

http://support.sas.com/kb/31/602.html

 

Don't know if it is still the case or not. Maybe you could try moving the user and password outside of NOPROMPT in separate parameters as encryption in the PASSWORD parameter is allowed.

milts
Pyrite | Level 9

You are correct it seems including the encoded password does not work in the connection string. I had to do a manual work around that picks up the password from a file while supressing the log when assigning the librefs.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1735 views
  • 1 like
  • 2 in conversation