Hi, I posted this in another thread but realise the title shd change so I posted this problem with another title:
The "returnvalue" in the VBscript could not be parsed to the ASP if-else statement. Anyone can help?
The "returnvalue" in the VBscript could not be parsed to the ASP if-else statement. Anyone can help?
Code:
<%
DIM NAME, YEAR, RATING, returnvalue
NAME = Request.Form("NAME")
YEAR = Request.Form("YEAR")
RATING = Request.Form("RATING")
sqlcheck="select * from subdb_subcon_rating WHERE NAME LIKE '"&NAME&"' AND YEAR LIKE '"&YEAR&"'"
Set check = OraDatabase.Execute(sqlcheck)
if check.EOF then
sql="INSERT into subdb_subcon_rating(NAME, YEAR, RATING) values ('"&NAME&"','"&YEAR&"','"&RATING&"')"
Set objRS = OraDatabase.Execute(sql)
%>
<script language="VBScript">
MsgBox "Records have been inserted",64,"Alert"
window.location= "input_records.asp"
</script>
<%
else
%>
<script language="VBScript">
returnvalue=MsgBox ("Records already exist in Database!"& vbCrLf &"Do you want to overwrite the records?",36,"Alert")
</script>
<%
if returnvalue=6 Then
OraDatabase.Execute("UPDATE subdb_subcon_rating SET RATING = '"&RATING&"' WHERE NAME LIKE '"&NAME&"' AND YEAR LIKE '"&YEAR&"'")%>
<script language="VBScript">
MsgBox "Records have been inserted",64,"Alert"
window.location="input_records.asp"
</script>
<%
else
%>
<script language="VBScript">
MsgBox "Records NOT inserted",16,"Alert"
history.go(-1)
</script>
<%
end if
end if