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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hiding username and password

Status
Not open for further replies.

JanS

Technical User
Feb 21, 2001
77
AU
Hi,

My question is two-fold.

1. Is there a way of hiding the username and password when connection to a SQL server database (code shown below) so that they cannot be seen if View/source is chosen?

2. If not, I store the username and password entered from the logon screen in session variables, how can session variables be accessed in VBScript?? ie how can I replace the hardcoded username and password with the values stored in the session variables?

'create database connection
set objConn=CreateObject("ADODB.Connection")
strConnection = "Provider=SQLOLEDB.1;Persist Security Info=False;Initial Catalog=SchoolStaffing;Data Source=development"
strConnection = strConnection & ";user id=schoolstaffing; password=sspword"
objConn.open strConnection

<SCRIPT language=&quot;vbscript&quot;>
private sub SaveCEODetails()

'generate the sql stmt
strSQL = &quot;select * from lookup&quot;

'create the recordset
set rsData = objConn.Execute(strSQL)
...do things here and close the recordset and db connection

end sub
</SCRIPT>
 
of course, the following code should be at the start of the code....oops pasted to the wrong place :(

<SCRIPT language=&quot;vbscript&quot;>
private sub SaveCEODetails()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top