Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Basing a recordset on a session variable

Posted 24 Oct 2004 23:20:52
1
has voted
24 Oct 2004 23:20:52 Andy Anderson posted:
HELP!! I am trying to personalise a welcome page for logged in users that will display information from three related tables in the sites access database. I have managed to show the logged in users profile based on Session("MM_Username" = MM_valUsername, and would very much like to use this to show more information that relates to this user. Whenever I create the page, I get the following error: ADODB.Field error '800a0bcd'. Can anyone help me please?

Replies

Replied 25 Oct 2004 16:36:40
25 Oct 2004 16:36:40 Lee Diggins replied:
Hi Andy

This error is stating that your recordset is empty, post your code - should be an easy fix.

Digga

Sharing Knowledge Saves Valuable Time!!!
Replied 25 Oct 2004 21:14:37
25 Oct 2004 21:14:37 Andy Anderson replied:
OK, here is the code as requested:

" CODEPAGE="1252"%>
<%
' *** Logout the current user.
MM_Logout = CStr(Request.ServerVariables("URL") & "?MM_Logoutnow=1"
If (CStr(Request("MM_Logoutnow") = "1" Then
Session.Contents.Remove("MM_Username"
Session.Contents.Remove("MM_UserAuthorization"
MM_logoutRedirectPage = "Gen_Logged_out.asp"
' redirect with URL parameters (remove the "MM_Logoutnow" query param).
if (MM_logoutRedirectPage = "" Then MM_logoutRedirectPage = CStr(Request.ServerVariables("URL")
If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "" Then
MM_newQS = "?"
For Each Item In Request.QueryString
If (Item <> "MM_Logoutnow" Then
If (Len(MM_newQS) > 1) Then MM_newQS = MM_newQS & "&"
MM_newQS = MM_newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
End If
Next
if (Len(MM_newQS) > 1) Then MM_logoutRedirectPage = MM_logoutRedirectPage & MM_newQS
End If
Response.Redirect(MM_logoutRedirectPage)
End If
%>
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="1,2,3"
MM_authFailedURL="admin_denied.asp"
MM_grantAccess=false
If Session("MM_Username" <> "" Then
If (false Or CStr(Session("MM_UserAuthorization")="" Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization")>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?" >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL"
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<!--#include file="Connections/login_script.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_login_script_STRING
Recordset1.Source = "SELECT Carer_Name_1, loginUsername, Placed_Child_1, Support_Worker_Name FROM carer"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Recordset2__MMColParam
Recordset2__MMColParam = "1"
If (Session("LoginUsername" <> "" Then
Recordset2__MMColParam = Session("LoginUsername"
End If
%>
<%
Dim Recordset2
Dim Recordset2_numRows

Set Recordset2 = Server.CreateObject("ADODB.Recordset"
Recordset2.ActiveConnection = MM_login_script_STRING
Recordset2.Source = "SELECT LoginUsername, Telephone FROM Tbl_Carer WHERE LoginUsername = '" + Replace(Recordset2__MMColParam, "'", "''" + "'"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()

Recordset2_numRows = 0
%>
<html>
<head>
<title>Carers Home Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- Fireworks MX Dreamweaver MX target. Created Tue Feb 17 21:58:16 GMT-2400 2004-->
<script language="JavaScript">function mmLoadMenus() {
if (window.mm_menu_0226165910_0) return;
window.mm_menu_0226165910_0 = new Menu("root",141,16,"Verdana, Arial, Helvetica, sans-serif",10,"#0066CC","#003366","#999999","#FFFFFF","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
mm_menu_0226165910_0.addMenuItem("News from Roy","window.open('securecarers1.asp', '_self');";
mm_menu_0226165910_0.addMenuItem("Medical Guidance","window.open('securecarers2.asp', '_self');";
mm_menu_0226165910_0.addMenuItem("Nursing Assistance","window.open('securecarers3.asp', '_self');";
mm_menu_0226165910_0.addMenuItem("Autistic Support","window.open('securecarers4.asp', '_self');";
mm_menu_0226165910_0.addMenuItem("General Help","window.open('securecarers5.asp', '_self');";
mm_menu_0226165910_0.addMenuItem("Events","window.open('securecarers6.asp', '_self');";
mm_menu_0226165910_0.addMenuItem("Ideas for days out","window.open('securecarers7.asp', '_self');";
mm_menu_0226165910_0.addMenuItem("Fun - n - Games","window.open('securecarers8.asp', '_self');";
mm_menu_0226165910_0.addMenuItem("Carers Forum","window.open('securecarers9.asp', '_self');";
mm_menu_0226165910_0.addMenuItem("On-line Support","window.open('securecarers10.asp', '_self');";
mm_menu_0226165910_0.addMenuItem("Emergency Contact","window.open('securecarers11.asp', '_self');";
mm_menu_0226165910_0.addMenuItem("Downloads","window.open('securecarers12.asp', '_self');";
mm_menu_0226165910_0.hideOnMouseOut=true;
mm_menu_0226165910_0.bgColor='#555555';
mm_menu_0226165910_0.menuBorder=1;
mm_menu_0226165910_0.menuLiteBgColor='#FFFFFF';
mm_menu_0226165910_0.menuBorderBgColor='#333333';

mm_menu_0226165910_0.writeMenus();
} // mmLoadMenus()
<!--
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?")>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over" {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down" {
nbArr = document[grpName];
if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#"!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape"&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<script language="JavaScript" src="mm_menu.js"></script>
<link href="CredoMain.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#CCCCFF" onLoad="MM_preloadImages('bannerimg/credocarebannerp_r6_c4_f2.jpg','bannerimg/credocarebannerp_r6_c4_f4.jpg','bannerimg/credocarebannerp_r6_c4_f3.jpg')">
<script language="JavaScript1.2">mmLoadMenus();</script>
<table border="0" cellpadding="0" cellspacing="0" width="902">
<!-- fwtable fwsrc="FW_credocarebannerpage.png" fwbase="credocarebannerpage.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<tr>
<td><img src="bannerimg/spacer.gif" width="25" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="83" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="81" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="2" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="32" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="49" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="83" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="110" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="89" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="127" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="107" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="108" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2"><img name="credocarebannerp_r1_c1" src="bannerimg/credocarebannerp_r1_c1.jpg" width="25" height="35" border="0" alt=""></td>
<td rowspan="4" colspan="6"><a href="admin_allowed.asp"><img name="credocarebannerp_r1_c2" src="bannerimg/credocarebannerp_r1_c2.jpg" width="200" height="79" border="0" alt=""></a></td>
<td colspan="3"><img name="credocarebannerp_r1_c8" src="bannerimg/credocarebannerp_r1_c8.jpg" width="133" height="25" border="0" alt=""></td>
<td><img name="credocarebannerp_r1_c11" src="bannerimg/credocarebannerp_r1_c11.jpg" width="110" height="25" border="0" alt=""></td>
<td><img name="credocarebannerp_r1_c12" src="bannerimg/credocarebannerp_r1_c12.jpg" width="89" height="25" border="0" alt=""></td>
<td colspan="2"><img name="credocarebannerp_r1_c13" src="bannerimg/credocarebannerp_r1_c13.jpg" width="128" height="25" border="0" alt=""></td>
<td><img name="credocarebannerp_r1_c15" src="bannerimg/credocarebannerp_r1_c15.jpg" width="107" height="25" border="0" alt=""></td>
<td rowspan="5"><img name="credocarebannerp_r1_c16" src="bannerimg/credocarebannerp_r1_c16.jpg" width="1" height="80" border="0" alt=""></td>
<td><img name="credocarebannerp_r1_c17" src="bannerimg/credocarebannerp_r1_c17.jpg" width="108" height="25" border="0" alt=""></td>
<td rowspan="6"><img name="credocarebannerp_r1_c18" src="bannerimg/credocarebannerp_r1_c18.jpg" width="1" height="104" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="25" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2" colspan="3"><img name="credocarebannerp_r2_c8" src="bannerimg/credocarebannerp_r2_c8.jpg" width="133" height="32" border="0" alt=""></td>
<td rowspan="2"><img name="credocarebannerp_r2_c11" src="bannerimg/credocarebannerp_r2_c11.jpg" width="110" height="32" border="0" alt=""></td>
<td rowspan="2"><img name="credocarebannerp_r2_c12" src="bannerimg/credocarebannerp_r2_c12.jpg" width="89" height="32" border="0" alt=""></td>
<td rowspan="2" colspan="2"><img name="credocarebannerp_r2_c13" src="bannerimg/credocarebannerp_r2_c13.jpg" width="128" height="32" border="0" alt=""></td>
<td rowspan="2"><img name="credocarebannerp_r2_c15" src="bannerimg/credocarebannerp_r2_c15.jpg" width="107" height="32" border="0" alt=""></td>
<td rowspan="2"><img name="credocarebannerp_r2_c17" src="bannerimg/credocarebannerp_r2_c17.jpg" width="108" height="32" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="10" border="0" alt=""></td>
</tr>
<tr>
<td rowspan="2"><img name="credocarebannerp_r3_c1" src="bannerimg/credocarebannerp_r3_c1.jpg" width="25" height="44" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="22" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3"><img name="credocarebannerp_r4_c8" src="bannerimg/credocarebannerp_r4_c8.jpg" width="133" height="22" border="0" alt=""></td>
<td><img name="credocarebannerp_r4_c11" src="bannerimg/credocarebannerp_r4_c11.jpg" width="110" height="22" border="0" alt=""></td>
<td><img name="credocarebannerp_r4_c12" src="bannerimg/credocarebannerp_r4_c12.jpg" width="89" height="22" border="0" alt=""></td>
<td colspan="2"><img name="credocarebannerp_r4_c13" src="bannerimg/credocarebannerp_r4_c13.jpg" width="128" height="22" border="0" alt=""></td>
<td><img name="credocarebannerp_r4_c15" src="bannerimg/credocarebannerp_r4_c15.jpg" width="107" height="22" border="0" alt=""></td>
<td><img name="credocarebannerp_r4_c17" src="bannerimg/credocarebannerp_r4_c17.jpg" width="108" height="22" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="22" border="0" alt=""></td>
</tr>
<tr>
<td colspan="15"><img name="credocarebannerp_r5_c1" src="bannerimg/credocarebannerp_r5_c1.jpg" width="792" height="1" border="0" alt=""></td>
<td><img name="credocarebannerp_r5_c17" src="bannerimg/credocarebannerp_r5_c17.jpg" width="108" height="1" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td><img name="credocarebannerp_r6_c1" src="bannerimg/credocarebannerp_r6_c1.jpg" width="25" height="24" border="0" alt=""></td>
<td><img name="credocarebannerp_r6_c2" src="bannerimg/credocarebannerp_r6_c2.jpg" width="1" height="24" border="0" alt=""></td>
<td><img name="credocarebannerp_r6_c11" src="bannerimg/credocarebannerp_r6_c11.jpg" width="83" height="24" border="0" alt=""></td>
<td colspan="3"><a href="Gen_Login.asp" target="_self" onMouseOut="MM_nbGroup('out');MM_startTimeout();" onMouseOver="MM_nbGroup('over','credocarebannerp_r6_c4','bannerimg/credocarebannerp_r6_c4_f2.jpg','bannerimg/credocarebannerp_r6_c4_f4.jpg',1);MM_showMenu(window.mm_menu_0226165910_0,0,24,null,'credocarebannerp_r6_c4')" onClick="MM_nbGroup('down','navbar1','credocarebannerp_r6_c4','bannerimg/credocarebannerp_r6_c4_f3.jpg',1);"><img src="bannerimg/credocarebannerp_r6_c4.jpg" alt="this is a button that links to the secure carers page" name="credocarebannerp_r6_c4" width="84" height="24" border="0" class="CredoMain"></a></td>
<td colspan="2"><img name="credocarebannerp_r6_c11" src="bannerimg/credocarebannerp_r6_c11.jpg" width="81" height="24" border="0" alt=""></td>
<td colspan="2"><img name="credocarebannerp_r6_c11" src="bannerimg/credocarebannerp_r6_c11.jpg" width="84" height="24" border="0" alt=""></td>
<td colspan="2"><img name="credocarebannerp_r6_c11" src="bannerimg/credocarebannerp_r6_c11.jpg" width="199" height="24" border="0" alt=""></td>
<td colspan="4"><img name="credocarebannerp_r6_c13" src="bannerimg/credocarebannerp_r6_c13.jpg" width="236" height="24" border="0" alt=""></td>
<td><img name="credocarebannerp_r6_c17" src="bannerimg/credocarebannerp_r6_c17.jpg" width="108" height="24" border="0" alt=""></td>
<td><img src="bannerimg/spacer.gif" width="1" height="24" border="0" alt=""></td>
</tr>
</table>
<p class="CredoMain"><font color="#0066CC" face="Gill Sans MT"><strong>Please
remember to log out when you have finished: <a href="<%= MM_Logout %>">Log
Out</a></strong></font></p>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="40%" valign="top">
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td bordercolor="#9900FF"><strong><font color="#0066CC" face="Gill Sans MT">Important
Information:</font></strong></td>
</tr>
<tr>
<td bordercolor="#9900FF"><strong><font color="#0066CC" face="Gill Sans MT"> Your
Profile:</font></strong></td>
</tr>
<tr>
<td bordercolor="#9900FF">
<p><font color="#0066CC" face="Gill Sans MT"><strong>Logged in as:</strong></font> <font color="#0066CC" face="Gill Sans MT"><strong><%=Session("MM_Username"%></strong></font></p>
<p><strong><font color="#0066CC" face="Gill Sans MT">Name: <%=Session("MM_forename"%> <%=Session("MM_surname"%></font></strong></p>
<p><strong><font color="#0066CC" face="Gill Sans MT">Email Address: <%=Session("MM_emailaddress"%>
</font></strong></p>
</td>
</tr>
<tr>
<td bordercolor="#9900FF"><strong><font color="#0066CC" face="Gill Sans MT">Support
Worker:</font></strong></td>
</tr>
<tr>
<td bordercolor="#9900FF"><p><strong><font color="#0066CC" face="Gill Sans MT"> <%=(Recordset1.Fields.Item("Support_Worker_Name".Value)%></font></strong></p>
</td>
</tr>
<tr>
<td bordercolor="#9900FF"><strong><font color="#0066CC" face="Gill Sans MT">Placements:</font></strong></td>
</tr>
<tr>
<td bordercolor="#9900FF"> <p><font color="#0066CC"> <strong><font face="Gill Sans MT"><%=(Recordset1.Fields.Item("Placed_Child_1".Value)%></font></strong></font></p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
<tr>
<td bordercolor="#9900FF"><font color="#0066CC"> <font face="Gill Sans MT"><strong><%=(Recordset2.Fields.Item("Telephone".Value)%></strong></font></font></td>
</tr>
<tr>
<td bordercolor="#9900FF"><font color="#0066CC"> </font></td>
</tr>
<tr>
<td bordercolor="#9900FF"><font color="#0066CC"> </font></td>
</tr>
<tr>
<td bordercolor="#9900FF"><font color="#0066CC"> </font></td>
</tr>
</table></td>
<td width="1%"> </td>
<td width="59%" valign="top" bordercolor="#9900FF">
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr bordercolor="#9900FF">
<td colspan="2"><strong><font color="#0066CC" face="Gill Sans MT">
<marquee>
sample news item
</marquee>
</font></strong></td>
</tr>
<tr bordercolor="#9900FF">
<td colspan="2">
<p> </p>
<p> </p>
<p> </p></td>
</tr>
<tr bordercolor="#9900FF">
<td width="89%"> </td>
<td width="11%">
<div align="right"><strong><font color="#0066CC" face="Gill Sans MT">Update</font></strong></div></td>
</tr>
<tr bordercolor="#9900FF">
<td colspan="2">
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
<tr bordercolor="#9900FF">
<td> </td>
<td><div align="right"><strong><font color="#0066CC" face="Gill Sans MT">Update</font></strong></div></td>
</tr>
<tr bordercolor="#9900FF">
<td colspan="2">
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
<tr bordercolor="#9900FF">
<td> </td>
<td><div align="right"><strong><font color="#0066CC" face="Gill Sans MT">Update</font></strong></div></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="3" cellpadding="3" cellspacing="3" bgcolor="#FFFFFF">
<tr>
<td><div align="center">
<p>
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="320" height="61">
<param name="movie" value="buttonlogospin.swf">
<param name="quality" value="high">
<embed src="buttonlogospin.swf" quality="high" pluginspage="www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="320" height="61"></embed></object>
</p>
<p><font color="#006699" face="Gill Sans MT">Staff click <a href="securestaffhome.asp" target="_self">HERE</a>
to return to the staff pages</font> </p>
</div></td>
</tr>
</table>
<p class="CredoMain"><strong><font color="#0066CC" face="Gill Sans MT"></font></strong></p>
<p> </p>
<p> <!-- Start of StatCounter Code -->
<script type="text/javascript" language="javascript">
var sc_project=307706;
var sc_partition=1;
</script>

<script type="text/javascript" language="javascript" src="www.statcounter.com/counter/counter.js"></script>
<noscript><a href="www.statcounter.com" target="_blank"><img src="c2.statcounter.com/counter.php?sc_project=307706&java=0" alt="counter" border="0"></a> </noscript>
<!-- End of StatCounter Code --></p>
<p> </p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
Recordset2.Close()
Set Recordset2 = Nothing
%>

I have tried everything and need to get this fixed, lets hope you can help!

Thanks
Replied 25 Oct 2004 21:23:10
25 Oct 2004 21:23:10 Andy Anderson replied:
Oooops' I didn't realise how much code there was! The error is on line 288, <%=(Recordset2.Fields.Item("Telephone".Value)%> and this information comes from a different table in the DB. I have used the recordset filter to only show records based on the session variable MM_Username. I look forward to receiving some help on this one

Replied 26 Oct 2004 11:04:34
26 Oct 2004 11:04:34 Lee Diggins replied:
Hi Andy

Before I go digging into the code, do you have a value in the Telephone field in the db for the unique_id/session variable?

Digga

Sharing Knowledge Saves Valuable Time!!!
Replied 26 Oct 2004 14:13:56
26 Oct 2004 14:13:56 Andy Anderson replied:
Hi Digga

Yes there is a value in the telephone field and I am able to view all records or the first of the recordsin the data range but not the record that relates to the user who is logged on.

Andy
Replied 26 Oct 2004 14:35:26
26 Oct 2004 14:35:26 Lee Diggins replied:
Hi Andy

Can you do a test response.write on the page to check to see if the session variable is populated, something like:

Response.Write(Session("LoginUsername")

Can you also do the same for Recordset2__MMColParam

Digga

Sharing Knowledge Saves Valuable Time!!!

Edited by - Digga the Wolf on 26 Oct 2004 14:43:22
Replied 26 Oct 2004 21:55:22
26 Oct 2004 21:55:22 Andy Anderson replied:
Hi Digga

I tried to do the Response.Write(Session("LoginUsername") on the page but it returned nothing! I am not convinced that I did it correctly though?

Andy

Replied 27 Oct 2004 10:21:23
27 Oct 2004 10:21:23 Lee Diggins replied:
Hi Andy

Try this on a new blank asp page in the website, but you need to login first:

Dim strOut

If (Session("LoginUsername" <> "" Then
strOut = Session("LoginUsername"
Else
strOut = "No Data!"
End If

Response.Write(strOut)

If the page displays the value 'No Data!', then you need to check your login page script to make sure you have assigned the correct value to Session("LoginUsername".

Let us know what your results are.

Digga

Sharing Knowledge Saves Valuable Time!!!
Replied 28 Oct 2004 00:49:00
28 Oct 2004 00:49:00 Andy Anderson replied:
Hi Digga,

You guessed it, it said "no data!", what does that mean? and what do I have to do now?

Andy
Replied 28 Oct 2004 10:31:26
28 Oct 2004 10:31:26 Lee Diggins replied:
Hi Andy

It appears that the problem is to do with the login page and the Session("LoginUsername" not having a value assigned to it. Make sure the Session("LoginUsername" is being assigned the correct value.

If the Session("MM_Username" works, why not use this or does this contain different data?

Digga

Sharing Knowledge Saves Valuable Time!!!
Replied 28 Oct 2004 23:18:03
28 Oct 2004 23:18:03 Andy Anderson replied:
Thanks for your help, the pages are working now!

Andy

Reply to this topic