Forums

ASP

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>

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.

&lt;%@LANGUAGE="VBSCRIPT"%&gt;
&lt;!--#include file="../Connections/knet2.asp" --&gt;
&lt;%
Dim Recordset1__varLogin
Recordset1__varLogin = "0"
if (Session("MM_valUsername" &lt;&gt; "" then Recordset1__varLogin = Session("MM_valUsername"
%&gt;
&lt;%
Dim Recordset1__varPass
Recordset1__varPass = "0"
if (Session("UserPass" &lt;&gt; "" then Recordset1__varPass = Session("UserPass"
%&gt;
&lt;%
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
%&gt;
&lt;%
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)
%&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Redirection&lt;/title&gt;
&lt;% if Recordset1.Fields.Item("accessLevel".Value = "admin" then %&gt;
&lt;meta http-equiv="Refresh" content="0; URL=adminlisting.asp"&gt;
&lt;% END IF %&gt;
&lt;/head&gt;
&lt;body bgcolor="#FFFFFF" text="#000000"&gt;
&lt;% IF Trim(Request.Cookies("access") = "admin" THEN %&gt;
&lt;% Response.Redirect("adminlisting.asp" %&gt;
&lt;% END IF %&gt;
&lt;% IF Trim(Request.Cookies("access") = "client" THEN %&gt;
&lt;% Response.Redirect("clientlisting.asp?comp="& Session("company") %&gt;
&lt;% END IF %&gt;
&lt;% IF Trim(Request.Cookies("access") = "designer" THEN %&gt;
&lt;% Response.Redirect("designlisting.asp" %&gt;
&lt;% END IF %&gt;
&lt;% IF Trim(Request.Cookies("access") = "accounts" THEN %&gt;
&lt;% Response.Redirect("acountlisting.asp" %&gt;
&lt;% END IF %&gt;
&lt;% IF Trim(Request.Cookies("access") = "ESB" THEN %&gt;
&lt;% Response.Redirect("www.printchannel.com/cgi-bin/xat/ELECTRICITYSB") %&gt;
&lt;% END IF %&gt;
&lt;% IF Trim(Request.Cookies("access") = "Mercer" THEN %&gt;
&lt;% Response.Redirect("www.printchannel.com/cgi-bin/xat/MERCER") %&gt;
&lt;% END IF %&gt;
&lt;% IF Trim(Request.Cookies("access") = "VHI" THEN %&gt;
&lt;% Response.Redirect("www.printchannel.com/cgi-bin/xat/VHI") %&gt;
&lt;% END IF %&gt;
&lt;br&gt;
&lt;%= Request.Cookies("cLogin" %&gt; &lt;%= Request.Cookies("access"%&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
Recordset1.Close()
%&gt;

That's the entirey of it, still can't manage to wrap my head around it.

Sam

Reply to this topic