How can I overcome this error?
Where should I add 'End'?
----------------------------------------
Error Type:
Microsoft VBScript compilation (0x800A03F6)
Expected 'End'
/maicsa/functions/fnc-default.asp, line 49
Else
-----------------------------------------


<%@ LANGUAGE="VBSCRIPT" %>
<!-- #INCLUDE file = "../inc-scripts/adocn.asp"-->
<%
Sub validateInfo()
dtExpiryDate = "Users Expiry Date"
dtCurrentDate = Date

strSQL = "SELECT * FROM userTable WHERE userName = '" & strName &
"' AND password = '" & strPassword & "'"
SET rsUser = OpenRecord(myCon, strSQL)
If Not isObject(rsUser) Then
Response.Write " Err : " & Err.description & " : " &
Err.number & "<br>"
Response.End
End If


Dim strNum
Dim strFirstDigit
Dim strSecDigit
Dim YourVariable
Dim strMsg

strNum = ""
YourVariable = "7012123"


strSecDigit = Left(YourVariable,2)
strFirstDigit = Left(strSecDigit,1)

If strFirstDigit = "0" Then
strNum = "0"
ElseIf strFirstDigit = "6" Then
strNum = "6"
Else
strNum = strSecDigit
End If

Select Case strNum
case "0","6","10","70"
strMsg = "Add 180 Days"
' SQL = "Update userTable Set [Date] = #" & DateAdd("d", 180,
rsUser("Date")) & "# Where userName = '" & strName & "'"
case Else
strMsg = "Add 90 Days"
' SQL = "Update userTable Set [Date] = #" & DateAdd("d", 90,
rsUser("Date")) & "# Where userName = '" & strName & "'"
End Select
response.write(strMsg)
Call ExecCommand(myCon, SQL)

Response.Redirect "../interactive/main.asp"
Else
Response.Redirect "../interactive_notregistered.asp"
end if
Else
Response.Redirect "../interactive_loginfail.asp"
End If

End Sub
Dim myCon, rsUser, strSQL
SET myCon = OpenConn()
dim strName, strPassword, strType
strName = request.form("pUserName")
strPassword = request.form("pPassword")
Call validateInfo()
SET myCon = nothing
%>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Re: VBScript compilation error by Ken

Ken
Tue Dec 16 23:12:27 CST 2003

This section:

<%
response.write(strMsg)
Call ExecCommand(myCon, SQL)

Response.Redirect "../interactive/main.asp"
Else
Response.Redirect "../interactive_notregistered.asp"
end if
Else
Response.Redirect "../interactive_loginfail.asp"
End If

End Sub
%>

Has no matching beginning If...then statements

Cheers
Ken


"Roy Davis" <rajesh@maicsa.org.my> wrote in message
news:%23EsHnqFxDHA.2064@TK2MSFTNGP10.phx.gbl...
:
: How can I overcome this error?
: Where should I add 'End'?
: ----------------------------------------
: Error Type:
: Microsoft VBScript compilation (0x800A03F6)
: Expected 'End'
: /maicsa/functions/fnc-default.asp, line 49
: Else
: -----------------------------------------
:
:
: <%@ LANGUAGE="VBSCRIPT" %>
: <!-- #INCLUDE file = "../inc-scripts/adocn.asp"-->
: <%
: Sub validateInfo()
: dtExpiryDate = "Users Expiry Date"
: dtCurrentDate = Date
:
: strSQL = "SELECT * FROM userTable WHERE userName = '" & strName &
: "' AND password = '" & strPassword & "'"
: SET rsUser = OpenRecord(myCon, strSQL)
: If Not isObject(rsUser) Then
: Response.Write " Err : " & Err.description & " : " &
: Err.number & "<br>"
: Response.End
: End If
:
:
: Dim strNum
: Dim strFirstDigit
: Dim strSecDigit
: Dim YourVariable
: Dim strMsg
:
: strNum = ""
: YourVariable = "7012123"
:
:
: strSecDigit = Left(YourVariable,2)
: strFirstDigit = Left(strSecDigit,1)
:
: If strFirstDigit = "0" Then
: strNum = "0"
: ElseIf strFirstDigit = "6" Then
: strNum = "6"
: Else
: strNum = strSecDigit
: End If
:
: Select Case strNum
: case "0","6","10","70"
: strMsg = "Add 180 Days"
: ' SQL = "Update userTable Set [Date] = #" & DateAdd("d", 180,
: rsUser("Date")) & "# Where userName = '" & strName & "'"
: case Else
: strMsg = "Add 90 Days"
: ' SQL = "Update userTable Set [Date] = #" & DateAdd("d", 90,
: rsUser("Date")) & "# Where userName = '" & strName & "'"
: End Select
: response.write(strMsg)
: Call ExecCommand(myCon, SQL)
:
: Response.Redirect "../interactive/main.asp"
: Else
: Response.Redirect "../interactive_notregistered.asp"
: end if
: Else
: Response.Redirect "../interactive_loginfail.asp"
: End If
:
: End Sub
: Dim myCon, rsUser, strSQL
: SET myCon = OpenConn()
: dim strName, strPassword, strType
: strName = request.form("pUserName")
: strPassword = request.form("pPassword")
: Call validateInfo()
: SET myCon = nothing
: %>
:
: *** Sent via Developersdex http://www.developersdex.com ***
: Don't just participate in USENET...get rewarded for it!