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

updation problem

Status
Not open for further replies.

sonun

IS-IT--Management
Dec 26, 2001
384
US
Subject : updation error Author : sonu Date : 11/25/2002 11:24:00 AM

I have this very simple page trying to do an updation. But when I submit the form I get a,
" The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed. "
I cannot for the life of me figure out the problem. Please advise.
(note: some of the code is not mine !!)

#UpdateInfo.asp (this is the first page)

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>
</HEAD>
<BODY>

<%
if Session(&quot;PasswordEq&quot;) = false then
Response.Write(&quot;<li>Password Fields were not Equal. Please Enter Again.</li><BR>&quot;)
end if

if Session(&quot;BlankFields&quot;) = true then
Response.Write(&quot;<li>Please Enter at Least 7 Chracters for the Password field</li><BR>&quot;)
end if
%>

<%
Set objConnection = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set objRecordSet = Server.CreateObject(&quot;ADODB.RecordSet&quot;)

objConnection.Open Application(&quot;telerad_ConnectionString&quot;) ,&quot;sa&quot;, &quot;&quot;

sql = &quot;select * from UserInfo where UserName = '&quot; & Session(&quot;Username&quot;) & &quot;'&quot;
Set objRecordSet = objConnection.Execute (sql)

function m(a,b)
if a = b then
m = &quot;checked&quot;
else
m = &quot;&quot;
end if
end function

%>

<form method=&quot;post&quot; action = &quot;UpdatePost.asp&quot; name=&quot;form1&quot;>
<input type =&quot;hidden&quot; name = &quot;Variable1&quot; value=&quot;Yahoo..!!!&quot; ></input>
<P>&nbsp;</P>
<P align=center><FONT size=7><STRONG>Personal Information</STRONG></FONT></P>
Username: <%=Response.Write(objRecordSet.Fields(&quot;UserName&quot;))%>

<p>Last name:&nbsp;&nbsp; <input value = <%=objRecordSet.Fields(&quot;LastName&quot;)%> name=&quot;Surname&quot;> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>First name:&nbsp; <input value = <%=objRecordSet.Fields(&quot;FirstName&quot;)%> name=&quot;Firstname&quot;> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<br>
<p>Change Password&nbsp;
<p>Enter new Password:&nbsp; <INPUT type=&quot;password&quot; name=&quot;Password1&quot;> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>Confirm new Password:&nbsp; <INPUT type = &quot;password&quot; name=&quot;Password2&quot;> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;</p>

<P align=center><FONT size=7><STRONG>Office Computer
Information</STRONG></FONT></P>
<P>Computer Type:&nbsp;
<input <%=m(objRecordSet.Fields(&quot;OfficeCompType&quot;),&quot;Laptop&quot;)%> type=&quot;radio&quot; value=&quot;Laptop&quot; name =&quot;officecomptype&quot;>Laptop&nbsp;&nbsp;&nbsp;
<input <%=m(objRecordSet.Fields(&quot;OfficeCompType&quot;),&quot;Desktop&quot;)%> type=&quot;radio&quot; name=&quot;officecomptype&quot; value=&quot;Desktop&quot;> Desktop</P>
<p>Operating System:&nbsp;
<input <%=m(objRecordSet.Fields(&quot;OfficeOS&quot;),&quot;Win 2000&quot;)%> type=&quot;radio&quot; name =&quot;officeOS&quot; value=&quot;Win 2000&quot;>Win2000&nbsp;&nbsp;&nbsp;
<input <%=m(objRecordSet.Fields(&quot;OfficeOS&quot;),&quot;Win NT&quot;)%> type=&quot;radio&quot; name=&quot;officeOS&quot; value=&quot;Win NT&quot;>Win NT&nbsp;&nbsp;&nbsp;
<input <%=m(objRecordSet.Fields(&quot;OfficeOS&quot;),&quot;Win XP&quot;)%> type=&quot;radio&quot; name=&quot;officeOS&quot; value=&quot;Win XP&quot;>WinXP&nbsp;&nbsp;
<input <%=m(objRecordSet.Fields(&quot;OfficeOS&quot;),&quot;MAC OS&quot;)%> type=&quot;radio&quot; name=&quot;officeOS&quot; value=&quot;MAC OS&quot;> MAC OS </p>
<p>Screen Resolution:&nbsp;
<input <%=m(objRecordSet.Fields(&quot;OfficeScreenRes&quot;),&quot;800 x 600&quot;)%> type=&quot;radio&quot; name=&quot;officeResolution&quot; value=&quot;800 x 600&quot; > 800 x 600&nbsp;&nbsp;
<input <%=m(objRecordSet.Fields(&quot;OfficeScreenRes&quot;),&quot;1024 x 768&quot;)%> type=&quot;radio&quot; name=&quot;officeResolution&quot; value=&quot;1024 x 768&quot;>1024 x 768&nbsp;&nbsp;
<input <%=m(objRecordSet.Fields(&quot;OfficeScreenRes&quot;),&quot;1280 x 1024&quot;)%> type=&quot;radio&quot; name=&quot;officeResolution&quot; value=&quot;1280 x 1024&quot;> 1280 x 1024</p>
<p>Processor Speed:&nbsp;
<input name=&quot;officespeed&quot; value = <%=Response.Write(objRecordSet.Fields(&quot;OfficeProcessorSpeed&quot;))%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RAM:&nbsp;
<input name=&quot;officeRAM&quot; value = <%=Response.Write(objRecordSet.Fields(&quot;OfficeRAM&quot;))%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Screen Size:&nbsp;
<input name=&quot;officesize&quot; value = <%=Response.Write(objRecordSet.Fields(&quot;OfficeScreenSize&quot;))%>></p>
<p>Connection Type:&nbsp; <input <%=m(objRecordSet.Fields(&quot;OfficeConnectionType&quot;),&quot;LAN&quot;)%> type=&quot;radio&quot; name=&quot;officecontype&quot; value=&quot;LAN&quot; >
LAN&nbsp;&nbsp; <input <%=m(objRecordSet.Fields(&quot;OfficeConnectionType&quot;),&quot;DSL&quot;)%> type=&quot;radio&quot; name=&quot;officecontype&quot; value=&quot;DSL&quot;>&nbsp; DSL&nbsp;&nbsp;&nbsp;
<input <%=m(objRecordSet.Fields(&quot;OfficeConnectionType&quot;),&quot;Cable&quot;)%> type=&quot;radio&quot; name=&quot;officecontype&quot; value=&quot;Cable&quot;> Cable&nbsp;&nbsp; <input <%=m(objRecordSet.Fields(&quot;OfficeConnectionType&quot;),&quot;Modem&quot;)%> type=&quot;radio&quot; name=&quot;officecontype&quot; value=&quot;Modem&quot;>&nbsp;
Modem</p>
<P>&nbsp;</P>
<P align=center><FONT size=7><STRONG>Home Computer
Information</STRONG></FONT></P>
<P>Computer Type:&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeCompType&quot;),&quot;Laptop&quot;)%> name=homecomptype type=radio value=Laptop>
Laptop&nbsp;&nbsp;&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeCompType&quot;),&quot;Desktop&quot;)%> name=homecomptype type=radio value=Desktop>
Desktop</P>
<P>Operating System:&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeOS&quot;),&quot;Win 2000&quot;)%> name=homeOS type=radio
value=&quot;Win 2000&quot;>Win 2000&nbsp;&nbsp;&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeOS&quot;),&quot;Win NT&quot;)%> name=homeOS type=radio
value=&quot;Win NT&quot;>Win NT&nbsp;&nbsp;&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeOS&quot;),&quot;Win XP&quot;)%> name=homeOS type=radio
value=&quot;Win XP&quot;>Win XP&nbsp;&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeOS&quot;),&quot;MAC OS&quot;)%> name=homeOS type=radio value=&quot;MAC OS&quot;> MAC
OS </P>
<P>Screen Resolution:&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeScreenRes&quot;),&quot;800 x 600&quot;)%> name=homeResolution type=radio
value=&quot;800 x 600&quot;> 800 x 600&nbsp;&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeScreenRes&quot;),&quot;1024 x 768&quot;)%> name=homeResolution type=radio
value=&quot;1024 x 768&quot;>1024 x 768&nbsp;&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeScreenRes&quot;),&quot;1280 x 1024&quot;)%> name=homeResolution type=radio
value=&quot;1280 x 1024&quot;> 1280 x 1024</P>
<P>Processor Speed:&nbsp; <INPUT
name=homespeed value = <%=Response.Write(objRecordSet.Fields(&quot;HomeProcessorSpeed&quot;))%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RAM:&nbsp;
<INPUT name=homeRAM value= <%=Response.Write(objRecordSet.Fields(&quot;HomeRAM&quot;))%>>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Screen Size:&nbsp; <INPUT
name=homesize value = <%=Response.Write(objRecordSet.Fields(&quot;HomeScreenSize&quot;))%>></P>
<P>Connection Type:&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeConnectionType&quot;),&quot;LAN&quot;)%> name=homecontype type=radio value=LAN>
LAN&nbsp;&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeConnectionType&quot;),&quot;DSL&quot;)%> name=homecontype type=radio value=DSL>&nbsp;
DSL&nbsp;&nbsp;&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeConnectionType&quot;),&quot;Cable&quot;)%> name=homecontype type=radio value=Cable>
Cable&nbsp;&nbsp; <INPUT <%=m(objRecordSet.Fields(&quot;HomeConnectionType&quot;),&quot;Modem&quot;)%> name=homecontype type=radio value=Modem>&nbsp; Modem</P>
<P>&nbsp;</P>
<p align=&quot;center&quot;>
<input type=&quot;reset&quot; value=&quot;Reset&quot; name=&quot;B2&quot;>
<input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;B1&quot;>
</form></P>

</BODY>
</HTML>

#This is the page it is submitting to

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>
</HEAD>
<BODY>

<%
Password1 = Request.Form.Item(&quot;Password1&quot;)
Password2 = Request.Form.Item(&quot;Password2&quot;)

SomethingWrong = false

if Password1 = &quot;&quot; OR Password2 = &quot;&quot;
SomethingWrong = true
Session(&quot;BlankFields&quot;) = true
end if

if Password1 <> Password2 then
SomethingWrong = true
Session(&quot;PasswordEq&quot;) = false
end if

if SomethingWrong = true then
Response.Redirect(&quot;Registration.asp&quot;)
end if
%>


else

<%
Set objConnection = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set objRecordSet = Server.CreateObject(&quot;ADODB.RecordSet&quot;)

objConnection.Open Application(&quot;telerad_ConnectionString&quot;) ,&quot;sa&quot;, &quot;&quot;

sql = &quot;UPDATE UserInfo SET &quot;

sql=sql & &quot;HomeCompType = '&quot; & Request.Form.Item(&quot;Homecomptype&quot;) & &quot;',&quot;
sql=sql & &quot;HomeOS = '&quot; & Request.Form.Item(&quot;HomeOS&quot;) & &quot;',&quot;
sql=sql & &quot;HomeScreenRes = '&quot; & Request.Form.Item(&quot;HomeResolution&quot;) & &quot;',&quot;
sql=sql & &quot;HomeProcessorSpeed = '&quot; & Request.Form.Item(&quot;Homespeed&quot;) & &quot;',&quot;
sql=sql & &quot;HomeRAM = '&quot; & Request.Form.Item(&quot;HomeRAM&quot;) & &quot;',&quot;
sql=sql & &quot;HomeScreenSize = '&quot; & Request.Form.Item(&quot;Homesize&quot;) & &quot;',&quot;
sql=sql & &quot;HomeConnectionType = '&quot; & Request.Form.Item(&quot;Homecontype&quot;) & &quot;',&quot;

sql=sql & &quot;OfficeCompType = '&quot; & Request.Form.Item(&quot;Officecomptype&quot;) & &quot;',&quot;
sql=sql & &quot;OfficeOS = '&quot; & Request.Form.Item(&quot;OfficeOS&quot;) & &quot;',&quot;
sql=sql & &quot;OfficeScreenRes = '&quot; & Request.Form.Item(&quot;OfficeResolution&quot;) & &quot;',&quot;
sql=sql & &quot;OfficeProcessorSpeed = '&quot; & Request.Form.Item(&quot;Officespeed&quot;) & &quot;',&quot;
sql=sql & &quot;OfficeRAM = '&quot; & Request.Form.Item(&quot;OfficeRAM&quot;) & &quot;',&quot;
sql=sql & &quot;OfficeScreenSize = '&quot; & Request.Form.Item(&quot;Officesize&quot;) & &quot;',&quot;
sql=sql & &quot;OfficeConnectionType = '&quot; & Request.Form.Item(&quot;Officecontype&quot;) & &quot;'&quot;
sql=sql & &quot;Password = '&quot; & Request.Form.Item(&quot;Password1&quot;) & &quot;'&quot;
sql = sql & &quot; where UserName = '&quot; & Session(&quot;Username&quot;) & &quot;'&quot;


Set objRecordSet = objConnection.Execute (sql)
Response.Write(sql)

end if

%>

<BR>
<BR>
Update Complete.
<BR>
Click <a href = &quot;Survey.asp&quot;>here</a> to Submit a survey.

</BODY>
</HTML>



Thanks







 
There is a correction in the code in the middle. This is the origninal code where I was getting the problem.
if SomethingWrong = true then
Response.Redirect(&quot;Registration.asp&quot;)

else


Set objConnection = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set objRecordSet = Server.CreateObject(&quot;ADODB.RecordSet&quot;)

I was just trying to break up the code to narrow down the problem.

Thanks and sorry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top