Forums
This topic is locked
Login Redirects!
Posted 26 Sep 2001 13:38:10
1
has voted
26 Sep 2001 13:38:10 Samantha Jones posted:
Hopefully someone can help me out here! I have created a login page...no problem. BUT, what i need to do is send each user to a different page once the login is verified. I have got as far as sending to login to a "redirect" page, but i keep on getting errors like:
ADODB.Field error'800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
and the line which it refers to states this:
Session("Name" = TRIM(Recordset1.Fields.Item("privName".Value)
I am pretty sure that it's something simple, but i can't see where the problem is.
Let me know if you can wrap your brain around it!
Ta
Replies
Replied 26 Sep 2001 16:03:17
26 Sep 2001 16:03:17 Viktor Farcic replied:
Two possible answers:
1. Your recordset isn't created or
2. You don't have records that match criteria.
Send us bigger part of code.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hopefully someone can help me out here! I have created a login page...no problem. BUT, what i need to do is send each user to a different page once the login is verified.
I have got as far as sending to login to a "redirect" page, but i keep on getting errors like:
ADODB.Field error'800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
and the line which it refers to states this:
Session("Name" = TRIM(Recordset1.Fields.Item("privName".Value)
I am pretty sure that it's something simple, but i can't see where the problem is.
Let me know if you can wrap your brain around it!
Ta
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
1. Your recordset isn't created or
2. You don't have records that match criteria.
Send us bigger part of code.
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Hopefully someone can help me out here! I have created a login page...no problem. BUT, what i need to do is send each user to a different page once the login is verified.
I have got as far as sending to login to a "redirect" page, but i keep on getting errors like:
ADODB.Field error'800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
and the line which it refers to states this:
Session("Name" = TRIM(Recordset1.Fields.Item("privName".Value)
I am pretty sure that it's something simple, but i can't see where the problem is.
Let me know if you can wrap your brain around it!
Ta
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 26 Sep 2001 16:10:07
26 Sep 2001 16:10:07 Samantha Jones replied:
Hiya, ok...the recordset has been created and all the fields are there..but here's the code...as requested.
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/knet2.asp" -->
<%
Dim Recordset1__varLogin
Recordset1__varLogin = "0"
if (Session("MM_valUsername" <> "" then Recordset1__varLogin = Session("MM_valUsername"
%>
<%
Dim Recordset1__varPass
Recordset1__varPass = "0"
if (Session("UserPass" <> "" then Recordset1__varPass = Session("UserPass"
%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_knet2_STRING
Recordset1.Source = "SELECT accessLevel, companyName, privName, privID FROM priv WHERE login = '" + Replace(Recordset1__varLogin, "'", "''" + "' AND password = '" + Replace(Recordset1__varPass, "'", "''" + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Session("Name" = TRIM(Recordset1.Fields.Item("privName".Value)
Response.Cookies("access" = TRIM(Recordset1.Fields.Item("accessLevel".Value)
Session("company" = TRIM(Recordset1.Fields.Item("companyName".Value)
Response.Cookies("cLogin" = Recordset1.Fields.Item("privName".Value
Session("ID" = TRIM(Recordset1.Fields.Item("privID".Value)
%>
<html>
<head>
<title>Redirection</title>
<% if Recordset1.Fields.Item("accessLevel".Value = "admin" then %>
<meta http-equiv="Refresh" content="0; URL=adminlisting.asp">
<% END IF %>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<% IF Trim(Request.Cookies("access") = "admin" THEN %>
<% Response.Redirect("adminlisting.asp" %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "client" THEN %>
<% Response.Redirect("clientlisting.asp?comp="& Session("company") %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "designer" THEN %>
<% Response.Redirect("designlisting.asp" %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "accounts" THEN %>
<% Response.Redirect("acountlisting.asp" %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "ESB" THEN %>
<% Response.Redirect("www.printchannel.com/cgi-bin/xat/ELECTRICITYSB") %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "Mercer" THEN %>
<% Response.Redirect("www.printchannel.com/cgi-bin/xat/MERCER") %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "VHI" THEN %>
<% Response.Redirect("www.printchannel.com/cgi-bin/xat/VHI") %>
<% END IF %>
<br>
<%= Request.Cookies("cLogin" %> <%= Request.Cookies("access"%>
</body>
</html>
<%
Recordset1.Close()
%>
That's the entirey of it, still can't manage to wrap my head around it.
Sam
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/knet2.asp" -->
<%
Dim Recordset1__varLogin
Recordset1__varLogin = "0"
if (Session("MM_valUsername" <> "" then Recordset1__varLogin = Session("MM_valUsername"
%>
<%
Dim Recordset1__varPass
Recordset1__varPass = "0"
if (Session("UserPass" <> "" then Recordset1__varPass = Session("UserPass"
%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_knet2_STRING
Recordset1.Source = "SELECT accessLevel, companyName, privName, privID FROM priv WHERE login = '" + Replace(Recordset1__varLogin, "'", "''" + "' AND password = '" + Replace(Recordset1__varPass, "'", "''" + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Session("Name" = TRIM(Recordset1.Fields.Item("privName".Value)
Response.Cookies("access" = TRIM(Recordset1.Fields.Item("accessLevel".Value)
Session("company" = TRIM(Recordset1.Fields.Item("companyName".Value)
Response.Cookies("cLogin" = Recordset1.Fields.Item("privName".Value
Session("ID" = TRIM(Recordset1.Fields.Item("privID".Value)
%>
<html>
<head>
<title>Redirection</title>
<% if Recordset1.Fields.Item("accessLevel".Value = "admin" then %>
<meta http-equiv="Refresh" content="0; URL=adminlisting.asp">
<% END IF %>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<% IF Trim(Request.Cookies("access") = "admin" THEN %>
<% Response.Redirect("adminlisting.asp" %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "client" THEN %>
<% Response.Redirect("clientlisting.asp?comp="& Session("company") %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "designer" THEN %>
<% Response.Redirect("designlisting.asp" %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "accounts" THEN %>
<% Response.Redirect("acountlisting.asp" %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "ESB" THEN %>
<% Response.Redirect("www.printchannel.com/cgi-bin/xat/ELECTRICITYSB") %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "Mercer" THEN %>
<% Response.Redirect("www.printchannel.com/cgi-bin/xat/MERCER") %>
<% END IF %>
<% IF Trim(Request.Cookies("access") = "VHI" THEN %>
<% Response.Redirect("www.printchannel.com/cgi-bin/xat/VHI") %>
<% END IF %>
<br>
<%= Request.Cookies("cLogin" %> <%= Request.Cookies("access"%>
</body>
</html>
<%
Recordset1.Close()
%>
That's the entirey of it, still can't manage to wrap my head around it.
Sam