Article ID: 163159
Article Last Modified on 1/19/2007
Query: GetUserPass
------------------
Type: Select Query
Field: CustomerID
Table: Customers
Parameter Data Type
----------------------------
[UserParam] Text
[PassParam] Text
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-
1252">
<TITLE>GetUserPass</TITLE>
</HEAD>
<BODY>
<%
Param = Request.QueryString("Param")
Data = Request.QueryString("Data")
%>
<%
If IsObject(Session("NorthwindASP_conn")) Then
Set conn = Session("NorthwindASP_conn")
Else
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "NorthwindASP","",""
Set Session("NorthwindASP_conn") = conn
End If
%>
Replace the above code with the following (the rest of the code
should remain the same):
<%
If IsObject(Session("NorthwindASP_conn")) Then
Set conn = Session("NorthwindASP_conn")
Else
If Request.Form("[UserParam]") = "" then
response.redirect "GetUserPass_1.HTML"
Else
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "NorthwindASP", Request.Form("[UserParam]"), _
Request.Form("[PassParam]")
Set Session("NorthwindASP_conn") = conn
End If
End If
%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-
1252">
<TITLE>GetUserPass</TITLE>
</HEAD>
<BODY>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-
1252">
<TITLE>Customers</TITLE>
</HEAD>
<BODY>
<%
If IsObject(Session("NorthwindASP_conn")) Then
Set conn = Session("NorthwindASP_conn")
Else
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "NorthwindASP","",""
Set Session("NorthwindASP_conn") = conn
End If
%>
Replace the above code with the following (the rest of the code
should remain the same):
<%
If IsObject(Session("NorthwindASP_conn")) Then
Set conn = Session("NorthwindASP_conn")
Else
If Request.Form("[UserParam]") = "" then
response.redirect "GetUserPass_2.HTML"
Else
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "NorthwindASP", Request.Form("[UserParam]"), _
Request.Form("[PassParam]")
Set Session("NorthwindASP_conn") = conn
End If
End If
%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-
1252">
<TITLE>Customers</TITLE>
</HEAD>
<BODY>
Save the Customers_1.asp file and close it. These changes will
make the ASP file use the HTML form to request a username and password if the
user had not yet entered a username and password for the session. <FORM METHOD="GET" ACTION="GetUserPass_1.asp">
<FORM METHOD="POST" ACTION="GetUserPass_1.asp">
[PassParam] <INPUT TYPE="Text" NAME="[PassParam]"><P>
[PassParam] <INPUT TYPE="Password" NAME="[PassParam]"><P>
<FORM METHOD="POST" ACTION="GetUserPass_1.asp">
and change it to:
<FORM METHOD="POST" ACTION="Customers_1.asp">
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
Not a valid account name or password.
Additional query words: internet intranet iis pws peer web services personal server inf
Keywords: kbhowto kbusage KB163159