Dilys
asked on
(0x80020009) Exception occurred
Hi there please i need help !!!!
When a request has been added to my site an email is generated to me and the supervisors.The email has a link to the website.Now the issue here is that I keep getting the error message
Error Type:
(0x80020009)
Exception occurred.
/tasksite/version1/COMMON/ asp/allHP. asp, line 13
line 13 is" IF RSLogin("user_id") <> Session("user_id") Then
Below is the code.
<%@ Language=VBScript %>
<!-- #INCLUDE VIRTUAL ="taskSite/version1/inc/co nnstring.a sp"-->
<!-- #INCLUDE VIRTUAL ="taskSite/version1/inc/AD OVBS.INC"- ->
<%
sql = "select user_Id, user_type "
sql =sql & "from tbl_users "
sql = sql & "WHERE user_id ='" & Session("user_id") & "'"
set RSLogin = conn.execute (sql)
IF RSLogin("user_id") <> Session("user_id") Then
Response.redirect "http://help/Requestsite/INDEX.asp"
else
'Response.write(sql)
if RSLogin("user_type") = "1" then
Response.Redirect "../../admin/asp/adminhome .asp"
elseif RSLogin("user_type") = "2" then
Response.Redirect "../../SYSTEMS/asp/sysHome .asp"
elseif RSLogin("user_type") = "3" then
Response.Redirect "../../SUPERVSR/asp/homeS. asp"
elseif RSLogin("user_type") = "4" then
Response.Redirect "../../user/asp/Uhome.asp"
else
Response.Redirect "http://help/Requestsite/INDEX.asp"
end if
end if
%>
Thanks!!!!
When a request has been added to my site an email is generated to me and the supervisors.The email has a link to the website.Now the issue here is that I keep getting the error message
Error Type:
(0x80020009)
Exception occurred.
/tasksite/version1/COMMON/
line 13 is" IF RSLogin("user_id") <> Session("user_id") Then
Below is the code.
<%@ Language=VBScript %>
<!-- #INCLUDE VIRTUAL ="taskSite/version1/inc/co
<!-- #INCLUDE VIRTUAL ="taskSite/version1/inc/AD
<%
sql = "select user_Id, user_type "
sql =sql & "from tbl_users "
sql = sql & "WHERE user_id ='" & Session("user_id") & "'"
set RSLogin = conn.execute (sql)
IF RSLogin("user_id") <> Session("user_id") Then
Response.redirect "http://help/Requestsite/INDEX.asp"
else
'Response.write(sql)
if RSLogin("user_type") = "1" then
Response.Redirect "../../admin/asp/adminhome
elseif RSLogin("user_type") = "2" then
Response.Redirect "../../SYSTEMS/asp/sysHome
elseif RSLogin("user_type") = "3" then
Response.Redirect "../../SUPERVSR/asp/homeS.
elseif RSLogin("user_type") = "4" then
Response.Redirect "../../user/asp/Uhome.asp"
else
Response.Redirect "http://help/Requestsite/INDEX.asp"
end if
end if
%>
Thanks!!!!
ASKER
Hi MaxOvrdv2
The code above did not work still getting the error
(0x80020009)
Exception occurred.
/tasksite/version1/COMMON/ asp/allHP. asp, line 16
The code above did not work still getting the error
(0x80020009)
Exception occurred.
/tasksite/version1/COMMON/
Hmmn,
Microsofts knowledgebase does not have an explanation for this error that has anything do with what you have here.
What happens if you do this:
Response.write(RSLogin("us er_id"))
Response.write(Session("us er_id"))
Fritz the Blank
Microsofts knowledgebase does not have an explanation for this error that has anything do with what you have here.
What happens if you do this:
Response.write(RSLogin("us
Response.write(Session("us
Fritz the Blank
ok... try this instead then...
if RSLogin.RecordCount<=0 then
Response.redirect "http://help/Requestsite/INDEX.asp"
else
rest fo the code
end if
you see... you are telling the Recordset to select from tblUsers WHERE user_id = Session("user_id").... therefore.. the recordset will be empty if the session id is not the same...
also... what type is user_id in the database??
if it is Interger/Numeric type... then there is no need for the extra commans after the = sign:
sql = sql & "WHERE user_id =" & Session("user_id")
Let me know...
MaxOvrdrv2
if RSLogin.RecordCount<=0 then
Response.redirect "http://help/Requestsite/INDEX.asp"
else
rest fo the code
end if
you see... you are telling the Recordset to select from tblUsers WHERE user_id = Session("user_id").... therefore.. the recordset will be empty if the session id is not the same...
also... what type is user_id in the database??
if it is Interger/Numeric type... then there is no need for the extra commans after the = sign:
sql = sql & "WHERE user_id =" & Session("user_id")
Let me know...
MaxOvrdrv2
ASKER
Hi Fritz
When i run your code
The userid is returned twice
IDHIDH %>
When i run your code
The userid is returned twice
IDHIDH %>
ASKER
Hi MaxOvrdrv2,
When i run your code it takes every request to the logging page and this should not be so. becasue when we have a session userid it should take the user to their welcome oage.
NOw the userid is a char field 3
I am using MSSQL 2000 DB
I think the RecordCount may have to do with it?
Thanks
When i run your code it takes every request to the logging page and this should not be so. becasue when we have a session userid it should take the user to their welcome oage.
NOw the userid is a char field 3
I am using MSSQL 2000 DB
I think the RecordCount may have to do with it?
Thanks
Okay, so we know that you are getting both values the way that you expect. I also see from your code that you wrote out the SQL statement and I trust that gave you what you expected. What is this about the RecordCount? I don't see it in your code...
Fritz the Blank
Fritz the Blank
ASKER
Hi MaxOvrdrv2,
When i run your code it takes every request to the logging page and this should not be so. becasue when we have a session userid it should take the user to their welcome oage.
NOw the userid is a char field 3
I am using MSSQL 2000 DB
I think the RecordCount may have to do with it?
Thanks
When i run your code it takes every request to the logging page and this should not be so. becasue when we have a session userid it should take the user to their welcome oage.
NOw the userid is a char field 3
I am using MSSQL 2000 DB
I think the RecordCount may have to do with it?
Thanks
ASKER
Fritz
when i use the recordcount function but it takes everyone to the login page. This should not be so if we have a session for the user. ie if the user is already logged in it should take the user to thier default welcome page.
when i use the recordcount function but it takes everyone to the login page. This should not be so if we have a session for the user. ie if the user is already logged in it should take the user to thier default welcome page.
ASKER
Fritz
when i use the recordcount function but it takes everyone to the login page. This should not be so if we have a session for the user. ie if the user is already logged in it should take the user to thier default welcome page.
when i use the recordcount function but it takes everyone to the login page. This should not be so if we have a session for the user. ie if the user is already logged in it should take the user to thier default welcome page.
But I don't see RecordCount in your code anywhere...
Fritz the Blank
Fritz the Blank
How about change the code to
IF CStr(RSLogin("user_id")) <> CStr(Session("user_id")) Then
IF CStr(RSLogin("user_id")) <> CStr(Session("user_id")) Then
ASKER
Hi Fritz,
MaxOvrdrv2 told me to use it in one of his postings so i did however it now takes all everyone to the login in page.
Well below is the code revised with the recordcount method
<%@ Language=VBScript %>
<!-- #INCLUDE VIRTUAL ="taskSite/version1/inc/co nnstring.a sp"-->
<!-- #INCLUDE VIRTUAL ="taskSite/version1/inc/AD OVBS.INC"- ->
<%
sql = "select user_Id, user_type "
sql =sql & "from tbl_users "
sql = sql & "WHERE user_id ='" & Session("user_id") & "'"
set RSLogin = conn.execute (sql)
'Response.write(RSLogin("u ser_id"))
'Response.write(Session("u ser_id"))
if RSLogin.RecordCount<=0 then
Response.redirect "http://som-wen2/tasksite/version1/INDEX.asp"
elseif RSLogin("user_type") = "1" then
Response.Redirect "../../admin/asp/adminhome .asp"
elseif RSLogin("user_type") = "2" then
Response.Redirect "../../SYSTEMS/asp/sysHome .asp"
elseif RSLogin("user_type") = "3" then
Response.Redirect "../../SUPERVSR/asp/homeS. asp"
elseif RSLogin("user_type") = "4" then
Response.Redirect "../../user/asp/Uhome.asp"
else
Response.Redirect "../../user/asp/Uhome.asp"
end if
%>
MaxOvrdrv2 told me to use it in one of his postings so i did however it now takes all everyone to the login in page.
Well below is the code revised with the recordcount method
<%@ Language=VBScript %>
<!-- #INCLUDE VIRTUAL ="taskSite/version1/inc/co
<!-- #INCLUDE VIRTUAL ="taskSite/version1/inc/AD
<%
sql = "select user_Id, user_type "
sql =sql & "from tbl_users "
sql = sql & "WHERE user_id ='" & Session("user_id") & "'"
set RSLogin = conn.execute (sql)
'Response.write(RSLogin("u
'Response.write(Session("u
if RSLogin.RecordCount<=0 then
Response.redirect "http://som-wen2/tasksite/version1/INDEX.asp"
elseif RSLogin("user_type") = "1" then
Response.Redirect "../../admin/asp/adminhome
elseif RSLogin("user_type") = "2" then
Response.Redirect "../../SYSTEMS/asp/sysHome
elseif RSLogin("user_type") = "3" then
Response.Redirect "../../SUPERVSR/asp/homeS.
elseif RSLogin("user_type") = "4" then
Response.Redirect "../../user/asp/Uhome.asp"
else
Response.Redirect "../../user/asp/Uhome.asp"
end if
%>
I am sorry, I didn't see that.
What if you do this instead?
if Cint(RSLogin("user_type")) > 0 then
if RSLogin("user_type") = "1" then
Response.Redirect "../../admin/asp/adminhome .asp"
elseif RSLogin("user_type") = "2" then
Response.Redirect "../../SYSTEMS/asp/sysHome .asp"
elseif RSLogin("user_type") = "3" then
Response.Redirect "../../SUPERVSR/asp/homeS. asp"
elseif RSLogin("user_type") = "4" then
Response.Redirect "../../user/asp/Uhome.asp"
else
Response.Redirect "../../user/asp/Uhome.asp"
end if
else
Response.redirect "http://som-wen2/tasksite/version1/INDEX.asp"
end if
Fritz the Blank
What if you do this instead?
if Cint(RSLogin("user_type"))
if RSLogin("user_type") = "1" then
Response.Redirect "../../admin/asp/adminhome
elseif RSLogin("user_type") = "2" then
Response.Redirect "../../SYSTEMS/asp/sysHome
elseif RSLogin("user_type") = "3" then
Response.Redirect "../../SUPERVSR/asp/homeS.
elseif RSLogin("user_type") = "4" then
Response.Redirect "../../user/asp/Uhome.asp"
else
Response.Redirect "../../user/asp/Uhome.asp"
end if
else
Response.redirect "http://som-wen2/tasksite/version1/INDEX.asp"
end if
Fritz the Blank
make sure that you are setting the Session variable in the login script...
if you are getting this (everyone gets re-directed) then that means that the session that is being set in the login never matches the one in the database...
MaxOvrdrv2
if you are getting this (everyone gets re-directed) then that means that the session that is being set in the login never matches the one in the database...
MaxOvrdrv2
and also... there is something wrong with the way you are using it... if you base yourself on this:
IF RSLogin("user_id") <> Session("user_id") Then
Response.redirect "http://help/Requestsite/INDEX.asp"
else
'Response.write(sql)
if RSLogin("user_type") = "1" then
Response.Redirect "../../admin/asp/adminhome .asp"
elseif RSLogin("user_type") = "2" then
Response.Redirect "../../SYSTEMS/asp/sysHome .asp"
elseif RSLogin("user_type") = "3" then
Response.Redirect "../../SUPERVSR/asp/homeS. asp"
elseif RSLogin("user_type") = "4" then
Response.Redirect "../../user/asp/Uhome.asp"
else
Response.Redirect "http://help/Requestsite/INDEX.asp"
end if
end if
then it should look like this:
IF RSLogin.RecordCount<=0 Then
Response.redirect "http://help/Requestsite/INDEX.asp"
else
'Response.write(sql)
if RSLogin("user_type") = "1" then
Response.Redirect "../../admin/asp/adminhome .asp"
elseif RSLogin("user_type") = "2" then
Response.Redirect "../../SYSTEMS/asp/sysHome .asp"
elseif RSLogin("user_type") = "3" then
Response.Redirect "../../SUPERVSR/asp/homeS. asp"
elseif RSLogin("user_type") = "4" then
Response.Redirect "../../user/asp/Uhome.asp"
else
Response.Redirect "http://help/Requestsite/INDEX.asp"
end if
end if
MaxOvrdrv2
IF RSLogin("user_id") <> Session("user_id") Then
Response.redirect "http://help/Requestsite/INDEX.asp"
else
'Response.write(sql)
if RSLogin("user_type") = "1" then
Response.Redirect "../../admin/asp/adminhome
elseif RSLogin("user_type") = "2" then
Response.Redirect "../../SYSTEMS/asp/sysHome
elseif RSLogin("user_type") = "3" then
Response.Redirect "../../SUPERVSR/asp/homeS.
elseif RSLogin("user_type") = "4" then
Response.Redirect "../../user/asp/Uhome.asp"
else
Response.Redirect "http://help/Requestsite/INDEX.asp"
end if
end if
then it should look like this:
IF RSLogin.RecordCount<=0 Then
Response.redirect "http://help/Requestsite/INDEX.asp"
else
'Response.write(sql)
if RSLogin("user_type") = "1" then
Response.Redirect "../../admin/asp/adminhome
elseif RSLogin("user_type") = "2" then
Response.Redirect "../../SYSTEMS/asp/sysHome
elseif RSLogin("user_type") = "3" then
Response.Redirect "../../SUPERVSR/asp/homeS.
elseif RSLogin("user_type") = "4" then
Response.Redirect "../../user/asp/Uhome.asp"
else
Response.Redirect "http://help/Requestsite/INDEX.asp"
end if
end if
MaxOvrdrv2
ASKER
Hi Fritz,
MaxOvrdrv2 told me to use it in one of his postings so i did however it now takes all everyone to the login in page.
Well below is the code revised with the recordcount method
<%@ Language=VBScript %>
<!-- #INCLUDE VIRTUAL ="taskSite/version1/inc/co nnstring.a sp"-->
<!-- #INCLUDE VIRTUAL ="taskSite/version1/inc/AD OVBS.INC"- ->
<%
sql = "select user_Id, user_type "
sql =sql & "from tbl_users "
sql = sql & "WHERE user_id ='" & Session("user_id") & "'"
set RSLogin = conn.execute (sql)
'Response.write(RSLogin("u ser_id"))
'Response.write(Session("u ser_id"))
if RSLogin.RecordCount<=0 then
Response.redirect "http://som-wen2/tasksite/version1/INDEX.asp"
elseif RSLogin("user_type") = "1" then
Response.Redirect "../../admin/asp/adminhome .asp"
elseif RSLogin("user_type") = "2" then
Response.Redirect "../../SYSTEMS/asp/sysHome .asp"
elseif RSLogin("user_type") = "3" then
Response.Redirect "../../SUPERVSR/asp/homeS. asp"
elseif RSLogin("user_type") = "4" then
Response.Redirect "../../user/asp/Uhome.asp"
else
Response.Redirect "../../user/asp/Uhome.asp"
end if
%>
MaxOvrdrv2 told me to use it in one of his postings so i did however it now takes all everyone to the login in page.
Well below is the code revised with the recordcount method
<%@ Language=VBScript %>
<!-- #INCLUDE VIRTUAL ="taskSite/version1/inc/co
<!-- #INCLUDE VIRTUAL ="taskSite/version1/inc/AD
<%
sql = "select user_Id, user_type "
sql =sql & "from tbl_users "
sql = sql & "WHERE user_id ='" & Session("user_id") & "'"
set RSLogin = conn.execute (sql)
'Response.write(RSLogin("u
'Response.write(Session("u
if RSLogin.RecordCount<=0 then
Response.redirect "http://som-wen2/tasksite/version1/INDEX.asp"
elseif RSLogin("user_type") = "1" then
Response.Redirect "../../admin/asp/adminhome
elseif RSLogin("user_type") = "2" then
Response.Redirect "../../SYSTEMS/asp/sysHome
elseif RSLogin("user_type") = "3" then
Response.Redirect "../../SUPERVSR/asp/homeS.
elseif RSLogin("user_type") = "4" then
Response.Redirect "../../user/asp/Uhome.asp"
else
Response.Redirect "../../user/asp/Uhome.asp"
end if
%>
ASKER
Hi all,
I have tried everything you have written and its not working.As I said before the record count function returns every user to the logging in page.
I have verified that the userid and user-type are being generated. so I do not know what is going on.
Please help!!!!
I have tried everything you have written and its not working.As I said before the record count function returns every user to the logging in page.
I have verified that the userid and user-type are being generated. so I do not know what is going on.
Please help!!!!
have you tried my latest post?
MaxOvrdrv2
MaxOvrdrv2
ASKER
Hi MaxOvdrv2
I tried it
but i got the error below
(0x80020009)
Exception occurred.
/tasksite/version1/COMMON/ asp/allHP. asp, line 16
line 16 is
IF RSLogin("user_id") <> Session("user_id") Then
I tried it
but i got the error below
(0x80020009)
Exception occurred.
/tasksite/version1/COMMON/
line 16 is
IF RSLogin("user_id") <> Session("user_id") Then
I wonder if the problem isn't the line:
Response.redirect "http://help/Requestsite/INDEX.asp"
rather than:
IF RSLogin("user_id") <> Session("user_id") Then
What if you put this at the top of your page:
<%@ Language = VBScript %>
<%Response.Buffer = True%>
I know that there can be problems with the redirect if you don't have buffering enabled.
Fritz the Blank
Response.redirect "http://help/Requestsite/INDEX.asp"
rather than:
IF RSLogin("user_id") <> Session("user_id") Then
What if you put this at the top of your page:
<%@ Language = VBScript %>
<%Response.Buffer = True%>
I know that there can be problems with the redirect if you don't have buffering enabled.
Fritz the Blank
ASKER
I placed
<%Response.Buffer = True%>
well back to square 1 takes me to the loging page and not the specifeid user pages.
<%Response.Buffer = True%>
well back to square 1 takes me to the loging page and not the specifeid user pages.
Okay, well that is progess, because at least we found out what was causing your error. So, the good news--we know the answer to your original question, the bad news--we have a new question about why your code doesn't work as expected....
Fritz the Blank
Fritz the Blank
What happens if you use your original code but with the buffering enabled?
Fritz the Blank
Fritz the Blank
I am also wondering about this line:
IF RSLogin("user_id") <> Session("user_id") Then
Have you tried isolating this to make sure that it works? You might also try this instead:
If strComp(RSLogin("user_id") ,Session(" user_id"), 1) = 0 then
that will compare the two strings regardless of case. If you want to make a distinction between upper and lower case, use:
If strComp(RSLogin("user_id") ,Session(" user_id"), 0) = 0 then
Fritz the Blank
IF RSLogin("user_id") <> Session("user_id") Then
Have you tried isolating this to make sure that it works? You might also try this instead:
If strComp(RSLogin("user_id")
that will compare the two strings regardless of case. If you want to make a distinction between upper and lower case, use:
If strComp(RSLogin("user_id")
Fritz the Blank
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And it would still be helpful to enable the buffering no matter what you do.
Fritz the Blank
Fritz the Blank
ASKER
Thanks Everyone for your help.
I figured it out by
Checking to see if userid is blank then redirect to login page
IF Session("user_id") = "" then
Response.redirect "http://help/INDEX.asp"
Else
sql statement
select *
where session userid = userid
then code to display pages based on user_type.
If rslogin ..........
Well thanks everyone for your help !!!!!!
I figured it out by
Checking to see if userid is blank then redirect to login page
IF Session("user_id") = "" then
Response.redirect "http://help/INDEX.asp"
Else
sql statement
select *
where session userid = userid
then code to display pages based on user_type.
If rslogin ..........
Well thanks everyone for your help !!!!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I am happy that a solution has been reached. Be sure to close this question out,
Fritz the Blank
Fritz the Blank
good thinking... see.. you're better than us... ;-) lol!
MaxOvrdrv2
MaxOvrdrv2
MaxOvrdrv2,
That's not what I meant!!!
I just wanted to ask why we didn't get that way earlier when I asked.
BTW, I left the information about split() and join() in the other post.
Fritz the Blank
That's not what I meant!!!
I just wanted to ask why we didn't get that way earlier when I asked.
BTW, I left the information about split() and join() in the other post.
Fritz the Blank
no no frits.. my last post was not meant for you... :) i meant: see Dilys... you're better than us! :)
and yes... thanks for the split join info... very useful and helpful... thank you very much! :)
MaxOvrdrv2
and yes... thanks for the split join info... very useful and helpful... thank you very much! :)
MaxOvrdrv2
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Split Points - fritz_the_blank / MaxOvrdrv2
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
GaryC123
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
Split Points - fritz_the_blank / MaxOvrdrv2
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
GaryC123
EE Cleanup Volunteer
if RSLogin("user_id")<>TheId then
MaxOvrdrv2