Asp – Add data into database using IF Statement

asp-classic

I would like to add data into database using if statement which based on certain condition..but my codes below doesn't work..need your advise.

<% If (rs_view.Fields.Item("CGPAOverall").Value>="2.00") Then %>
rs_view("Status")="Proceed"

<% Else %>

rs_view("Status")="Stop"

<% End If %>

I would like to save the result direct into database. How can I do that? Can't get the right codes for this. Hope you can help. Thanks.

Best Solution

I think you need to remove all of your "<%" and "%>" except for the first and last one.

<% If (rs_view.Fields.Item("CGPAOverall").Value>="2.00") Then
rs_view("Status")="Proceed"

Else

rs_view("Status")="Stop"

End If %>
Related Question