View Full Version : If Then statement confusion

07-13-2004, 07:11 PM
Hi, I'm trying to let only one user (590CENTER77701) has access to delete or edit a record from a database. I have all users logging in and maintaining their usernames in their browser session. So, I assume that you could compare the Session with the string 590CENTER77701 like below:

<% If Session("UID") = "590CENTER77701" Then %>
<a href="edit_a_debtee.asp?ID=<%=FP_FieldURL(fp_rs,"ID")%>">Edit</a> |
<a href="deleteConfirm.asp?ID=<%=FP_FieldURL(fp_rs,'ID')%>">Delete</a>
<% End If %>

But when I try to view the page, I get the following error message:

Microsoft VBScript compilation (0x800A03EA)
Syntax error
/sop/results.asp, line 134, column 33

For the life of me, I cannot see what is wrong with the code I have above.

07-13-2004, 07:50 PM
It would help if you pointed out where exactly is line 134, column 33.


07-13-2004, 09:15 PM
where are you getting this value FP_FieldURL(fp_rs,'ID') from? what does fp_rs & ID stand for? are they coming from a data base?

07-14-2004, 03:00 AM
You can't use single quotes as string delimiter in vbscript unlike in javascript.

<a href="deleteConfirm.asp?ID=<%=FP_FieldURL(fp_rs,'ID')%>">Delete</a>