error in code
I have the following error in my ASP if and else stmt,and I have tried diff things on it and it's not working.( the code looks fine to me)
Here's the error:
Microsoft VBScript compilation (0x800A03F6)
Expected 'End'
Here's the code:
<% Response.Buffer = true %>
<html>
<head>
<Title>Passoword change website</title>
</head>
<body>
<h2>Password change response<h2>
<%
'Declare variable needed
Dim strSql
Dim adCmdText
adCmdText = 1
'Retrieve the values
varStudentID = Request.Form("StudentId")
varPassword = Request.Form("Password")
varNewpassword = Request.Form("NewPassword")
'start building sql statement
strSql = "Update Try Set"
strSql = strSql & " Password ='" & varNewpassword & "'"
strSql = strSql & " WHERE StudentID =" & varStudentID
strSql = strSql & " AND Password='" & varPassword & "'"
'Create and Open connection to database
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.OPen "DSN=new1"
if objconn.eof then
Response.Write "Incorrect username or password"
'Create command object
Set objCmd = Server.CreateObject("ADODB.Command")
'Set Command Properties
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = strSql
objCmd.CommandType = adCmdText
'Execute Command
set objRS = objCmd.Execute
'Check if the user entered a valid username and password.
If objRS.EOF or objRS.BOF Then
Response.Write "Incorrect Username or password please try again"
Response.Clear
Response.Redirect "New112.asp"
Else
Response.Write "You have successfuly changed your password"
End If
'Response.Write " Your passwords has been changed."
'Response.write " The number of record that has changed is: " & _
' intnumofrecord & " records<BR><BR>"
Set objRS = Nothing
objRS.close
Set objCmd = Nothing
objConn.Close
Set objConn = Nothing
%>
</body>
</html>
|