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

Can't redirect pages

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Why i can't redirect to the pages with the following code.

It seems that problem lies in this [if (Request (&quot;text1&quot;) <> &quot;&quot; and Request (&quot;text2&quot;) <> &quot;&quot; ) Then]



<%

if (Request (&quot;text1&quot;) <> &quot;&quot; and Request (&quot;text2&quot;) <> &quot;&quot; ) Then

Dim adoCon , adoRec ' ADO connection object
Dim ConnString
Dim myNameID, myUserID, myPwd, myDept, myYr, myEmail, SQL

myNameID = Request.Form (&quot;text1&quot;)
myUserID = Request.Form (&quot;text2&quot;)
myPwd = Request.Form (&quot;password1&quot;)
myDept = Request.Form (&quot;select1&quot;)
myYr = Request.Form (&quot;select10&quot;)
myEmail= Request.Form (&quot;text3&quot;)

Set adoCon = Server.CreateObject(&quot;ADODB.Connection&quot;)
Set adoRec=server.CreateObject (&quot;ADODB.Recordset&quot;)
ConnString=&quot;driver={sql server};server=CON7; database=user;DSN=localserver;PWD=sa;UID=sa;&quot;
adoCon.Open ConnString

adoRec.ActiveConnection = adoCon

SQL=&quot;UPDATE info &quot; & _
&quot;SET NameID='&quot; & myNameID & &quot;', &quot; & _
&quot;UserID='&quot; & myUserID & &quot;', &quot; & _
&quot;password='&quot; & myPwd & &quot;', &quot; & _
&quot;yearinfo='&quot; & myYr & &quot;', &quot; & _
&quot;email='&quot; & myEmail & &quot;', &quot; & _
&quot;WHERE department='&quot; & myDept & &quot;'&quot;

adoCon.Execute (SQL)
Set adoCon = Nothing
adoCon.Close

Response.Redirect (&quot;Success.asp&quot;)

else%>

<script>
window.alert (&quot;Records cannot be updated&quot;)
</script>
<%end if%>
X-)
 
Change your line to be Response.Redirect &quot;Success.asp&quot; (i.e. remove the parens) and that should work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top