Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL to get user password

Status
Not open for further replies.

robertfah

Programmer
Mar 20, 2006
380
US
I've got a windows app that uses a Crystal Report to show data from our DB. My issue with it is that in code, it requires a Login name and Password for the DB. I do not want to hard-code this info for obvious reasons, so is there a way I can retrieve a password for a specific DB user with SQL? If there is, then I can put that in a SP and call my SP from my code to return the password.
 
You can use integrated security in crystal report. It will use currently loged user credentials.

Viewer, scheduler and manager for Crystal reports.
Send your report everywhere.
 
Thanks RTag, but what if this isn't an option for me (it is, I'm just really curious if there's a built-in SP or if someone came up with something to do this)?
 
If you are able to retrieve the user password this will compromise the security.
Integrated security is the most secured way to access the data however you need to manage the user(s) rights inside the database (which may be a problem). The other option is to create database user with appropriate rights and to pass always the same user name and password (no matter who is currently logged on the machine). You may encrypt the password and save it in the application configuration file and decrypt it right before using it in crystal reports.


Viewer, scheduler and manager for Crystal reports.
Send your report everywhere.
 
No you cannot use T/SQL to get a users password.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / SQL 2005 BI / SQL 2008 DBA / SQL 2008 DBD / SQL 2008 BI / MWSS 3.0: Configuration / MOSS 2007: Configuration)
MCITP (SQL 2005 DBA / SQL 2008 DBA / SQL 2005 DBD / SQL 2008 DBD / SQL 2005 BI / SQL 2008 BI)
MCM (SQL 2008)
MVP

My Site
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top