Solved

Classic ASP Code Error...

Posted on 2004-08-16
10
212 Views
Last Modified: 2010-05-02
The code below ceases to repeat once the user changes the session"A" to "1"

I have the same code on a different page and it works.

Surely, it's a misplaced code somewhere but I have been staring at it for an hour and can't find it.

-------------------------------------

<%@LANGUAGE="VBSCRIPT"%>
<!--#include virtual="adovbs.inc"-->
<%
session("A")=1

if request.QueryString("A") = 1 then
session("A") = 1
else
'session("A") = 0
end if
%>

<% if request.QueryString("A") = 0 then
session("A") = 0
else
'session("A") = 1
end if
%>


<% if request.QueryString("myAssigned") ="1" then
session("filterMyAssigned") = True
else
'session("filterMyAssigned") = False
end if
%>
<% if request.QueryString("Building") <>"" then
session("filterMyAssigned") = False
else
'session("filterMyAssigned") = False
end if
%>

<% if request.form("assignedto") <> "" then %>
<!--#include file="assignTicketScript.asp" -->
<% else %>
<% end if %>

<!--#include file="../Connections/conn_itss.asp" -->
<%
if right(left(session("strPermissions"), 17),1) <> "1" then
response.Redirect("../authentication/access_denied.asp")
else
end if
%>
<%
Dim rs_all_libRequests_yet_filtered__MMColParam
rs_all_libRequests_yet_filtered__MMColParam = "1"
if (Request.QueryString("Building") <> "") then rs_all_libRequests_yet_filtered__MMColParam = Request.QueryString("Building")
%>
<%
Dim rs_all_libRequests_yet_filtered__closedorpending
rs_all_libRequests_yet_filtered__closedorpending = "no"
if (Request.QueryString("closedorpending")   <> "") then rs_all_libRequests_yet_filtered__closedorpending = Request.QueryString("closedorpending")  
%>
<%
Dim rs_all_libRequests_yet_filtered__sorter
rs_all_libRequests_yet_filtered__sorter = "Submit_Date"
If (request.querystring("SortBy")   <> "") Then
  rs_all_libRequests_yet_filtered__sorter = request.querystring("SortBy")  
End If
%>
<% if session("filterMyAssigned") = False then

set rs_all_libRequests_yet_filtered = Server.CreateObject("ADODB.Recordset")
rs_all_libRequests_yet_filtered.ActiveConnection = MM_conn_itss_STRING
rs_all_libRequests_yet_filtered.Source = "SELECT *  FROM libraryRequests  WHERE Building = '" + Replace(rs_all_libRequests_yet_filtered__MMColParam, "'", "''") + "' and closed = " + Replace(rs_all_libRequests_yet_filtered__closedorpending, "'", "''") + "  ORDER BY " + Replace(rs_all_libRequests_yet_filtered__sorter, "'", "''") + " ASC"
rs_all_libRequests_yet_filtered.CursorType = 0
rs_all_libRequests_yet_filtered.CursorLocation = 2
rs_all_libRequests_yet_filtered.LockType = 3
rs_all_libRequests_yet_filtered.Open()
rs_all_libRequests_yet_filtered_numRows = 0

else

set rs_all_libRequests_yet_filtered = Server.CreateObject("ADODB.Recordset")
rs_all_libRequests_yet_filtered.ActiveConnection = MM_conn_itss_STRING
rs_all_libRequests_yet_filtered.Source = "SELECT *  FROM libraryRequests  WHERE Building = '" + Replace(rs_all_libRequests_yet_filtered__MMColParam, "'", "''") + "' and closed = " + Replace(rs_all_libRequests_yet_filtered__closedorpending, "'", "''") + "  ORDER BY " + Replace(rs_all_libRequests_yet_filtered__sorter, "'", "''") + " ASC"
rs_all_libRequests_yet_filtered.CursorType = 0
rs_all_libRequests_yet_filtered.CursorLocation = 2
rs_all_libRequests_yet_filtered.LockType = 3
rs_all_libRequests_yet_filtered.Open()
rs_all_libRequests_yet_filtered_numRows = 0

end if

%>
<%
Dim rs_libraryFolks__MMColParam
rs_libraryFolks__MMColParam = "1"
If (Session("blnViewAllReservations") <> "") Then
  rs_libraryFolks__MMColParam = Session("blnViewAllReservations")
End If
%>
<%
Dim rs_libraryFolks
Dim rs_libraryFolks_numRows

Set rs_libraryFolks = Server.CreateObject("ADODB.Recordset")
rs_libraryFolks.ActiveConnection = MM_conn_itss_STRING
rs_libraryFolks.Source = "SELECT * FROM Staff WHERE MID([strPermissions], 17, 1) = " + Replace(rs_libraryFolks__MMColParam, "'", "''") + ""
rs_libraryFolks.CursorType = 0
rs_libraryFolks.CursorLocation = 2
rs_libraryFolks.LockType = 1
rs_libraryFolks.Open()

rs_libraryFolks_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 50
Dim Repeat1__index
Repeat1__index = 0
rs_all_libRequests_yet_filtered_numRows = rs_all_libRequests_yet_filtered_numRows + Repeat1__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

' set the record count
rs_all_libRequests_yet_filtered_total = rs_all_libRequests_yet_filtered.RecordCount

' set the number of rows displayed on this page
If (rs_all_libRequests_yet_filtered_numRows < 0) Then
  rs_all_libRequests_yet_filtered_numRows = rs_all_libRequests_yet_filtered_total
Elseif (rs_all_libRequests_yet_filtered_numRows = 0) Then
  rs_all_libRequests_yet_filtered_numRows = 1
End If

' set the first and last displayed record
rs_all_libRequests_yet_filtered_first = 1
rs_all_libRequests_yet_filtered_last  = rs_all_libRequests_yet_filtered_first + rs_all_libRequests_yet_filtered_numRows - 1

' if we have the correct record count, check the other stats
If (rs_all_libRequests_yet_filtered_total <> -1) Then
  If (rs_all_libRequests_yet_filtered_first > rs_all_libRequests_yet_filtered_total) Then rs_all_libRequests_yet_filtered_first = rs_all_libRequests_yet_filtered_total
  If (rs_all_libRequests_yet_filtered_last > rs_all_libRequests_yet_filtered_total) Then rs_all_libRequests_yet_filtered_last = rs_all_libRequests_yet_filtered_total
  If (rs_all_libRequests_yet_filtered_numRows > rs_all_libRequests_yet_filtered_total) Then rs_all_libRequests_yet_filtered_numRows = rs_all_libRequests_yet_filtered_total
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (rs_all_libRequests_yet_filtered_total = -1) Then

  ' count the total records by iterating through the recordset
  rs_all_libRequests_yet_filtered_total=0
  While (Not rs_all_libRequests_yet_filtered.EOF)
    rs_all_libRequests_yet_filtered_total = rs_all_libRequests_yet_filtered_total + 1
    rs_all_libRequests_yet_filtered.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (rs_all_libRequests_yet_filtered.CursorType > 0) Then
    rs_all_libRequests_yet_filtered.MoveFirst
  Else
    rs_all_libRequests_yet_filtered.Requery
  End If

  ' set the number of rows displayed on this page
  If (rs_all_libRequests_yet_filtered_numRows < 0 Or rs_all_libRequests_yet_filtered_numRows > rs_all_libRequests_yet_filtered_total) Then
    rs_all_libRequests_yet_filtered_numRows = rs_all_libRequests_yet_filtered_total
  End If

  ' set the first and last displayed record
  rs_all_libRequests_yet_filtered_first = 1
  rs_all_libRequests_yet_filtered_last = rs_all_libRequests_yet_filtered_first + rs_all_libRequests_yet_filtered_numRows - 1
  If (rs_all_libRequests_yet_filtered_first > rs_all_libRequests_yet_filtered_total) Then rs_all_libRequests_yet_filtered_first = rs_all_libRequests_yet_filtered_total
  If (rs_all_libRequests_yet_filtered_last > rs_all_libRequests_yet_filtered_total) Then rs_all_libRequests_yet_filtered_last = rs_all_libRequests_yet_filtered_total

End If
%>
<%
Dim MM_paramName
%>
<%
' *** Move To Record and Go To Record: declare variables

Set MM_rs    = rs_all_libRequests_yet_filtered
MM_rsCount   = rs_all_libRequests_yet_filtered_total
MM_size      = rs_all_libRequests_yet_filtered_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
  MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter

if (Not MM_paramIsDefined And MM_rsCount <> 0) then

  ' use index parameter if defined, otherwise use offset parameter
  r = Request.QueryString("index")
  If r = "" Then r = Request.QueryString("offset")
  If r <> "" Then MM_offset = Int(r)

  ' if we have a record count, check if we are past the end of the recordset
  If (MM_rsCount <> -1) Then
    If (MM_offset >= MM_rsCount Or MM_offset = -1) Then  ' past end or move last
      If ((MM_rsCount Mod MM_size) > 0) Then         ' last page not a full repeat region
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If

  ' move the cursor to the selected record
  i = 0
  While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1))
    MM_rs.MoveNext
    i = i + 1
  Wend
  If (MM_rs.EOF) Then MM_offset = i  ' set MM_offset to the last possible record

End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range

If (MM_rsCount = -1) Then

  ' walk to the end of the display range for this page
  i = MM_offset
  While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size))
    MM_rs.MoveNext
    i = i + 1
  Wend

  ' if we walked off the end of the recordset, set MM_rsCount and MM_size
  If (MM_rs.EOF) Then
    MM_rsCount = i
    If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount
  End If

  ' if we walked off the end, set the offset based on page size
  If (MM_rs.EOF And Not MM_paramIsDefined) Then
    If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
      If ((MM_rsCount Mod MM_size) > 0) Then
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If

  ' reset the cursor to the beginning
  If (MM_rs.CursorType > 0) Then
    MM_rs.MoveFirst
  Else
    MM_rs.Requery
  End If

  ' move the cursor to the selected record
  i = 0
  While (Not MM_rs.EOF And i < MM_offset)
    MM_rs.MoveNext
    i = i + 1
  Wend
End If
%>
<%
' *** Move To Record: update recordset stats

' set the first and last displayed record
rs_all_libRequests_yet_filtered_first = MM_offset + 1
rs_all_libRequests_yet_filtered_last  = MM_offset + MM_size
If (MM_rsCount <> -1) Then
  If (rs_all_libRequests_yet_filtered_first > MM_rsCount) Then rs_all_libRequests_yet_filtered_first = MM_rsCount
  If (rs_all_libRequests_yet_filtered_last > MM_rsCount) Then rs_all_libRequests_yet_filtered_last = MM_rsCount
End If

' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
  End If
Next

' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
  End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "")  Then MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> "") Then
    MM_joinChar = "&"
  Else
    MM_joinChar = ""
  End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links

MM_keepMove = MM_keepBoth
MM_moveParam = "index"

' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 0) Then
  MM_moveParam = "offset"
  If (MM_keepMove <> "") Then
    params = Split(MM_keepMove, "&")
    MM_keepMove = ""
    For i = 0 To UBound(params)
      nextItem = Left(params(i), InStr(params(i),"=") - 1)
      If (StrComp(nextItem,MM_moveParam,1) <> 0) Then
        MM_keepMove = MM_keepMove & "&" & params(i)
      End If
    Next
    If (MM_keepMove <> "") Then
      MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
    End If
  End If
End If

' set the strings for the move to links
If (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&"
urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="
MM_moveFirst = urlStr & "0"
MM_moveLast  = urlStr & "-1"
MM_moveNext  = urlStr & Cstr(MM_offset + MM_size)
prev = MM_offset - MM_size
If (prev < 0) Then prev = 0
MM_movePrev  = urlStr & Cstr(prev)
%>
<html>
<head>
<title>Administering Service Requests for Buildings</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


<link href="../Css/service.css" rel="stylesheet" type="text/css">
</head>
<body background="<%= Application("service_bg") %>">
<!--#include virtual="root_button_set_include_7_29_03.asp" -->
<% if right(left(session("strPermissions"), 17),1) = "1" then %>
<!--#include virtual="library/library_button_set_include_6-9-04.asp" -->
<% else %>
<% end if %>
<table width="100%" border="0">
  <tr class="tdblue">
    <td width="34%"> <p align="center"><font size="+2">
        <% dim clsdpend
clspnd = request.querystring("closedorpending")
if clspnd = "No" then
clspnd = "Pending"
else
clspnd ="Closed"
end if
%>
<% if session("filterMyAssigned") = True then %>
 <%= clspnd %> Service Requests Currently Assigned to:<br>
            >> <%= session("FirstName") & " " & session("LastName") %> <<<br>
            <%else%>


        <%= clspnd %> Service Requests for:<br>
            >> <%= Request.QueryString("building") %> <<
            
            <%end if
%>  
</font></p></td>
    <td width="35%"><div align="center">[Records <%=(rs_all_libRequests_yet_filtered_first)%> to <%=(rs_all_libRequests_yet_filtered_last)%> of <%=(rs_all_libRequests_yet_filtered_total)%>]</div></td>
    <td width="31%"> <div align="center">
        <table border="0" width="50%" align="center">
          <tr>
            <td width="23%" align="center"> <% If MM_offset <> 0 Then %>
              <a href="<%=MM_moveFirst%>"><img src="First.gif" border=0></a>
              <% End If ' end MM_offset <> 0 %> </td>
            <td width="31%" align="center"> <% If MM_offset <> 0 Then %>
              <a href="<%=MM_movePrev%>"><img src="PREVIOUS.gif" border=0></a>
              <% End If ' end MM_offset <> 0 %> </td>
            <td width="23%" align="center"> <% If Not MM_atTotal Then %>
              <a href="<%=MM_moveNext%>"><img src="NEXT.gif" border=0></a>
              <% End If ' end Not MM_atTotal %> </td>
            <td width="23%" align="center"> <% If Not MM_atTotal Then %>
              <a href="<%=MM_moveLast%>"><img src="Last.gif" border=0></a>
              <% End If ' end Not MM_atTotal %> </td>
            <td width="23%" align="center"><script language="Javascript">
function printit(){  
if (window.print) {
    window.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
}
}
</script> <script language="Javascript">  
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
    document.write('<form><input type=button value="Print" name="Print" onClick="printit()"></form>');        
}
</script></td>
          </tr>
        </table>
            <% if session("A") = 1 then %>
        <a href="libAdministering_buildings.asp?A=0&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Submit=Go" class="mainlink">HIDE Assignments Column</a>
            <% else %>
        <a href="libAdministering_buildings.asp?A=1&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Submit=Go" class="mainlink">SHOW Assignments Column</a></div></td>
  <%end if%>
</tr>
</table>
<table border="1" width="100%">
  <tr class="tblue">
    <td>
      <div align="center"><strong>ID</strong></div></td>
    <td>
      <div align="center"><a href="libAdministering_buildings.asp?A=<%=session("A")%>&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Sortby=SubmitDate"><strong>Submitted</strong></a> </div></td>
    <td>
      <div align="center"><a href="libAdministering_buildings.asp?A=<%=session("A")%>&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Sortby=EmailAddress"><strong>User
        Email</strong></a></div></td>
    <td><a href="libAdministering_buildings.asp?A=<%=session("A")%>&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Sortby=building">Building</a></td>
    <td>
      <div align="center"><a href="libAdministering_buildings.asp?A=<%=session("A")%>&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Sortby=ChooseProblem"><strong>Category</strong></a></div></td>
    <td><strong>Problem Statement</strong></td>
   <% if session("A") = 1 then %> <td>
      <div align="center">Assignment Info. </div></td>
        <%else
        end if %>
  </tr>
  <%
While ((Repeat1__numRows <> 0) AND (NOT rs_all_libRequests_yet_filtered.EOF))
%>
<%building=(rs_all_libRequests_yet_filtered.Fields.Item("Building").Value)%>
  <tr bgcolor="<%=bgcolor%>">
    <td class="bct"><%=(rs_all_libRequests_yet_filtered.Fields.Item("libReq_ID").Value)%></td>
    <td class="bct"><%=(rs_all_libRequests_yet_filtered.Fields.Item("submit_date").Value)%></td>
    <td nowrap><p><a href="mailto:<%=(rs_all_libRequests_yet_filtered.Fields.Item("EmailAddress").Value)%>" class="bct"><%emailAddress=(rs_all_libRequests_yet_filtered.Fields.Item("EmailAddress").Value)
      response.write emailAddress  %></a></p></td>
    <td class="bct"><%=building%></td>
    <td class="bct"><%=(rs_all_libRequests_yet_filtered.Fields.Item("ProblemCategory").Value)%></td>
    <td><span class="bct">
<%
' count the records for each looped rs's category and display the integer later
sqltemp="select * from blaServiceComments where parentID=" & (rs_all_libRequests_yet_filtered.Fields.Item("libReq_ID").Value)
set rstemp=Server.CreateObject("adodb.Recordset")
rstemp.open sqltemp, MM_conn_itss_STRING, adopenstatic
howmanyrecs=rstemp.recordcount
response.write "<font color=red><b>(" & howmanyrecs & ")</b></font> "
rstemp.close
set rstemp=nothing
%>


      <% sentProblemStatement = (rs_all_libRequests_yet_filtered.Fields.Item("ProblemStatement").Value)
       response.write sentProblemStatement
        %>
    </span>[<a href="libViewEditPending.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "libReq_ID=" & rs_all_libRequests_yet_filtered.Fields.Item("libReq_ID").Value %>" class="highlight">VIEW/EDIT</a>]<span class="bct"><font color="#0000CC"> - <font color="#006699" size="1"><%=(rs_all_libRequests_yet_filtered.Fields.Item("AssignedTo").Value)%></font></font></span></td>
    <% if session("A") = 1 then %>
     <td><div align="right"><span class="bct">
        </span><br>
        <% if (rs_all_libRequests_yet_filtered.Fields.Item("AssignedTo").Value) <> "" then%>
        <strong>Currently Assigned to: <span class="boldRed"><%=(rs_all_libRequests_yet_filtered.Fields.Item("AssignedTo").Value)%></span> <br>
        by <span class="boldGreen"><%=(rs_all_libRequests_yet_filtered.Fields.Item("assignedToBy").Value)%></span> </strong>
        <% else %>
        <strong>Unassigned</strong>
        <% end if %>
    </div>
      <form name="form1" method="post" action="libAdministering_buildings.asp?building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Submit=Go">
        <div align="right">Assign this ticket to:
          <input type="hidden" name="libReq_ID" value="<%=(rs_all_libRequests_yet_filtered.Fields.Item("libReq_ID").Value)%>">
          <input type="hidden" name="sentProblemStatement" value="<%=sentProblemStatement%>">
              <input type="hidden" name="emailAddress" value="<%=emailAddress%>">
              <input type="hidden" name="building" value="<%=building%>">
<select name="assignedto" size="1">
  <option value="">-- Select Library Staff --</option>
  <%
While (NOT rs_libraryFolks.EOF)
%>
  <option value="<%=(rs_libraryFolks.Fields.Item("EmailAddress").Value)%>"><%=(rs_libraryFolks.Fields.Item("EmailAddress").Value)%></option>
  <%
  rs_libraryFolks.MoveNext()
Wend
If (rs_libraryFolks.CursorType > 0) Then
  rs_libraryFolks.MoveFirst
Else
  rs_libraryFolks.Requery
End If
%>
          </select>
          <input type="submit" name="Submit" value="Go">
        </div>
    </form></td>
      <%
      else
      end if
      %>
  </tr>
  <% if bgcolor="" then bgcolor="cccccc" else bgcolor=""%>
  <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rs_all_libRequests_yet_filtered.MoveNext()
Wend
%>

</table>
</body>
</html>
<%
rs_all_libRequests_yet_filtered.Close()
%>
<%
rs_libraryFolks.Close()
Set rs_libraryFolks = Nothing
%>

0
Comment
Question by:smetterd
  • 5
  • 3
10 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 11814735
This looks like it was built with Dreamweaver.  Does "The code below ceases to repeat ..." mean that there's a repeating region, it looks like there is, and it stops working?  If not, what part of the code isn't repeating?
0
 
LVL 2

Author Comment

by:smetterd
ID: 11815134
You got it. It was originally built with DW, but includes a lot of stuff that wasn't DW-produced. The repeat region works fine as long as the user doesn't click on the link which forces a display of the "Assignments" column. Once the session variable A is set to 1 then the first record in the rs displays, but no more. If you set it back to 0 then you get the whole shee-bang.
0
 
LVL 2

Author Comment

by:smetterd
ID: 11815330
I should add that this is a service ticket system for our librarians. We use the same code for a technology service ticket system and it works fine!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 11816098
I looked over the code you posted and I'm not seeing the problem.  Since it only crops up when Session A = 1 I focused on the places where A's value is tested.  First, I combed through the code and matched up the If's and End If's.  They appear to match up.  Next, I erased most of the code leaving the link the that flip-flops between showing and hiding the assignments column.  That works as expected.  Last, I verified that Session A was consistantly called A and that the values were being assigned properly.  It all looks good to me.  Whatever it is I'm missing it.  Can you post the code for the identical, working page so I can compare them?  The only other suggestion I can think of is to throw in a few Response.Writes to show the path the code is taking and the value of the variables that control the path execution is taking.  That's the only way i can think of to track the problem down.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Author Comment

by:smetterd
ID: 11819926
Looks as if you and I went thru the same processes. I, too, inspected each page next to one another. Here's the working page:
_____________________________________

<%@LANGUAGE="VBSCRIPT"%>
<!--#include virtual="adovbs.inc"-->
<%
session("A")=1

if request.QueryString("A") = 1 then
session("A") = 1
else
'session("A") = 0
end if
%>

<% if request.QueryString("A") = 0 then
session("A") = 0
else
'session("A") = 1
end if
%>


<% if request.QueryString("myAssigned") ="1" then
session("filterMyAssigned") = True
else
'session("filterMyAssigned") = False
end if
%>
<% if request.QueryString("Building") <>"" then
session("filterMyAssigned") = False
else
'session("filterMyAssigned") = False
end if
%>

<% if request.form("assignedto") <> "" then %>
<!--#include file="assignTicketScript.asp" -->
<% else %>
<% end if %>
<% ' 3 = campus liason and 4 = tech liason
 if session("usertype") = 3 and request.querystring("building") <>  session("building") then
 response.redirect("notyourcampus.asp")
 end if
 %>
<!--#include file="../Connections/conn_itss.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="3,4,5"
MM_authFailedURL="../authentication/access_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
%>
<%
Dim rs_all_requests_yet_filtered__MMColParam
rs_all_requests_yet_filtered__MMColParam = "1"
if (Request.QueryString("Building") <> "") then rs_all_requests_yet_filtered__MMColParam = Request.QueryString("Building")
%>
<%
Dim rs_all_requests_yet_filtered__closedorpending
rs_all_requests_yet_filtered__closedorpending = "no"
if (Request.QueryString("closedorpending")   <> "") then rs_all_requests_yet_filtered__closedorpending = Request.QueryString("closedorpending")  
%>
<%
Dim rs_all_requests_yet_filtered__sorter
rs_all_requests_yet_filtered__sorter = "SubmitDate"
If (request.querystring("SortBy")  <> "") Then
  rs_all_requests_yet_filtered__sorter = request.querystring("SortBy")
End If
%>
<% if session("filterMyAssigned") = False then

set rs_all_requests_yet_filtered = Server.CreateObject("ADODB.Recordset")
rs_all_requests_yet_filtered.ActiveConnection = MM_conn_itss_STRING
rs_all_requests_yet_filtered.Source = "SELECT *  FROM Service_Requests  WHERE Building = '" + Replace(rs_all_requests_yet_filtered__MMColParam, "'", "''") + "' and closed = " + Replace(rs_all_requests_yet_filtered__closedorpending, "'", "''") + "  ORDER BY " + Replace(rs_all_requests_yet_filtered__sorter, "'", "''") + " ASC"
rs_all_requests_yet_filtered.CursorType = 0
rs_all_requests_yet_filtered.CursorLocation = 2
rs_all_requests_yet_filtered.LockType = 3
rs_all_requests_yet_filtered.Open()
rs_all_requests_yet_filtered_numRows = 0

else

set rs_all_requests_yet_filtered = Server.CreateObject("ADODB.Recordset")
rs_all_requests_yet_filtered.ActiveConnection = MM_conn_itss_STRING
rs_all_requests_yet_filtered.Source = "SELECT *  FROM Service_Requests  WHERE assignedTo = '" + session("emailAddress") + "' and closed = " + Replace(rs_all_requests_yet_filtered__closedorpending, "'", "''") + "  ORDER BY " + Replace(rs_all_requests_yet_filtered__sorter, "'", "''") + " ASC"
rs_all_requests_yet_filtered.CursorType = 0
rs_all_requests_yet_filtered.CursorLocation = 2
rs_all_requests_yet_filtered.LockType = 3
rs_all_requests_yet_filtered.Open()
rs_all_requests_yet_filtered_numRows = 0

end if

%>
<%
Dim rs_techBoyz__MMColParam
rs_techBoyz__MMColParam = "3"
If (Request("MM_EmptyValue") <> "") Then
  rs_techBoyz__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim rs_techBoyz
Dim rs_techBoyz_numRows

Set rs_techBoyz = Server.CreateObject("ADODB.Recordset")
rs_techBoyz.ActiveConnection = MM_conn_itss_STRING
rs_techBoyz.Source = "SELECT * FROM Staff WHERE UserType > " + Replace(rs_techBoyz__MMColParam, "'", "''") + ""
rs_techBoyz.CursorType = 0
rs_techBoyz.CursorLocation = 2
rs_techBoyz.LockType = 1
rs_techBoyz.Open()

rs_techBoyz_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = 50
Dim Repeat1__index
Repeat1__index = 0
rs_all_requests_yet_filtered_numRows = rs_all_requests_yet_filtered_numRows + Repeat1__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

' set the record count
rs_all_requests_yet_filtered_total = rs_all_requests_yet_filtered.RecordCount

' set the number of rows displayed on this page
If (rs_all_requests_yet_filtered_numRows < 0) Then
  rs_all_requests_yet_filtered_numRows = rs_all_requests_yet_filtered_total
Elseif (rs_all_requests_yet_filtered_numRows = 0) Then
  rs_all_requests_yet_filtered_numRows = 1
End If

' set the first and last displayed record
rs_all_requests_yet_filtered_first = 1
rs_all_requests_yet_filtered_last  = rs_all_requests_yet_filtered_first + rs_all_requests_yet_filtered_numRows - 1

' if we have the correct record count, check the other stats
If (rs_all_requests_yet_filtered_total <> -1) Then
  If (rs_all_requests_yet_filtered_first > rs_all_requests_yet_filtered_total) Then rs_all_requests_yet_filtered_first = rs_all_requests_yet_filtered_total
  If (rs_all_requests_yet_filtered_last > rs_all_requests_yet_filtered_total) Then rs_all_requests_yet_filtered_last = rs_all_requests_yet_filtered_total
  If (rs_all_requests_yet_filtered_numRows > rs_all_requests_yet_filtered_total) Then rs_all_requests_yet_filtered_numRows = rs_all_requests_yet_filtered_total
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (rs_all_requests_yet_filtered_total = -1) Then

  ' count the total records by iterating through the recordset
  rs_all_requests_yet_filtered_total=0
  While (Not rs_all_requests_yet_filtered.EOF)
    rs_all_requests_yet_filtered_total = rs_all_requests_yet_filtered_total + 1
    rs_all_requests_yet_filtered.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (rs_all_requests_yet_filtered.CursorType > 0) Then
    rs_all_requests_yet_filtered.MoveFirst
  Else
    rs_all_requests_yet_filtered.Requery
  End If

  ' set the number of rows displayed on this page
  If (rs_all_requests_yet_filtered_numRows < 0 Or rs_all_requests_yet_filtered_numRows > rs_all_requests_yet_filtered_total) Then
    rs_all_requests_yet_filtered_numRows = rs_all_requests_yet_filtered_total
  End If

  ' set the first and last displayed record
  rs_all_requests_yet_filtered_first = 1
  rs_all_requests_yet_filtered_last = rs_all_requests_yet_filtered_first + rs_all_requests_yet_filtered_numRows - 1
  If (rs_all_requests_yet_filtered_first > rs_all_requests_yet_filtered_total) Then rs_all_requests_yet_filtered_first = rs_all_requests_yet_filtered_total
  If (rs_all_requests_yet_filtered_last > rs_all_requests_yet_filtered_total) Then rs_all_requests_yet_filtered_last = rs_all_requests_yet_filtered_total

End If
%>
<%
' *** Move To Record and Go To Record: declare variables

Set MM_rs    = rs_all_requests_yet_filtered
MM_rsCount   = rs_all_requests_yet_filtered_total
MM_size      = rs_all_requests_yet_filtered_numRows
MM_uniqueCol = ""
MM_paramName = ""
MM_offset = 0
MM_atTotal = false
MM_paramIsDefined = false
If (MM_paramName <> "") Then
  MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "")
End If
%>
<%
' *** Move To Record: handle 'index' or 'offset' parameter

if (Not MM_paramIsDefined And MM_rsCount <> 0) then

  ' use index parameter if defined, otherwise use offset parameter
  r = Request.QueryString("index")
  If r = "" Then r = Request.QueryString("offset")
  If r <> "" Then MM_offset = Int(r)

  ' if we have a record count, check if we are past the end of the recordset
  If (MM_rsCount <> -1) Then
    If (MM_offset >= MM_rsCount Or MM_offset = -1) Then  ' past end or move last
      If ((MM_rsCount Mod MM_size) > 0) Then         ' last page not a full repeat region
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If

  ' move the cursor to the selected record
  i = 0
  While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1))
    MM_rs.MoveNext
    i = i + 1
  Wend
  If (MM_rs.EOF) Then MM_offset = i  ' set MM_offset to the last possible record

End If
%>
<%
' *** Move To Record: if we dont know the record count, check the display range

If (MM_rsCount = -1) Then

  ' walk to the end of the display range for this page
  i = MM_offset
  While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size))
    MM_rs.MoveNext
    i = i + 1
  Wend

  ' if we walked off the end of the recordset, set MM_rsCount and MM_size
  If (MM_rs.EOF) Then
    MM_rsCount = i
    If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount
  End If

  ' if we walked off the end, set the offset based on page size
  If (MM_rs.EOF And Not MM_paramIsDefined) Then
    If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then
      If ((MM_rsCount Mod MM_size) > 0) Then
        MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
      Else
        MM_offset = MM_rsCount - MM_size
      End If
    End If
  End If

  ' reset the cursor to the beginning
  If (MM_rs.CursorType > 0) Then
    MM_rs.MoveFirst
  Else
    MM_rs.Requery
  End If

  ' move the cursor to the selected record
  i = 0
  While (Not MM_rs.EOF And i < MM_offset)
    MM_rs.MoveNext
    i = i + 1
  Wend
End If
%>
<%
' *** Move To Record: update recordset stats

' set the first and last displayed record
rs_all_requests_yet_filtered_first = MM_offset + 1
rs_all_requests_yet_filtered_last  = MM_offset + MM_size
If (MM_rsCount <> -1) Then
  If (rs_all_requests_yet_filtered_first > MM_rsCount) Then rs_all_requests_yet_filtered_first = MM_rsCount
  If (rs_all_requests_yet_filtered_last > MM_rsCount) Then rs_all_requests_yet_filtered_last = MM_rsCount
End If

' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each Item In Request.QueryString
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
  End If
Next

' add the Form variables to the MM_keepForm string
For Each Item In Request.Form
  NextItem = "&" & Item & "="
  If (InStr(1,MM_removeList,NextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
  End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "")  Then MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> "") Then
    MM_joinChar = "&"
  Else
    MM_joinChar = ""
  End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links

MM_keepMove = MM_keepBoth
MM_moveParam = "index"

' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 0) Then
  MM_moveParam = "offset"
  If (MM_keepMove <> "") Then
    params = Split(MM_keepMove, "&")
    MM_keepMove = ""
    For i = 0 To UBound(params)
      nextItem = Left(params(i), InStr(params(i),"=") - 1)
      If (StrComp(nextItem,MM_moveParam,1) <> 0) Then
        MM_keepMove = MM_keepMove & "&" & params(i)
      End If
    Next
    If (MM_keepMove <> "") Then
      MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
    End If
  End If
End If

' set the strings for the move to links
If (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&"
urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="
MM_moveFirst = urlStr & "0"
MM_moveLast  = urlStr & "-1"
MM_moveNext  = urlStr & Cstr(MM_offset + MM_size)
prev = MM_offset - MM_size
If (prev < 0) Then prev = 0
MM_movePrev  = urlStr & Cstr(prev)
%>
<html>
<head>
<title>Administering Service Requests for Buildings</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


<link href="../Css/service.css" rel="stylesheet" type="text/css">
</head>
<body background="<%= Application("service_bg") %>">
<!--#include virtual="root_button_set_include_7_29_03.asp" -->
<% if session("UserType") >=3 then %>
<!--#include virtual="service/service_button_set_include_10_4_03.asp" -->
<% else %>
<% end if %>
<table width="100%" border="0">
  <tr class="tdblue">
    <td width="34%"> <p align="center"><font size="+2">
        <% dim clsdpend
clspnd = request.querystring("closedorpending")
if clspnd = "No" then
clspnd = "Pending"
else
clspnd ="Closed"
end if
%>
<% if session("filterMyAssigned") = True then %>
 <%= clspnd %> Service Requests Currently Assigned to:<br>
            >> <%= session("FirstName") & " " & session("LastName") %> <<<br>
            <%else%>


        <%= clspnd %> Service Requests for:<br>
            >> <%= Request.QueryString("building") %> <<
            
            <%end if
%>  
</font></p></td>
    <td width="35%"><div align="center">[Records <%=(rs_all_requests_yet_filtered_first)%> to <%=(rs_all_requests_yet_filtered_last)%> of <%=(rs_all_requests_yet_filtered_total)%>]</div></td>
    <td width="31%"> <div align="center">
        <table border="0" width="50%" align="center">
          <tr>
            <td width="23%" align="center"> <% If MM_offset <> 0 Then %>
              <a href="<%=MM_moveFirst%>"><img src="First.gif" border=0></a>
              <% End If ' end MM_offset <> 0 %> </td>
            <td width="31%" align="center"> <% If MM_offset <> 0 Then %>
              <a href="<%=MM_movePrev%>"><img src="PREVIOUS.gif" border=0></a>
              <% End If ' end MM_offset <> 0 %> </td>
            <td width="23%" align="center"> <% If Not MM_atTotal Then %>
              <a href="<%=MM_moveNext%>"><img src="NEXT.gif" border=0></a>
              <% End If ' end Not MM_atTotal %> </td>
            <td width="23%" align="center"> <% If Not MM_atTotal Then %>
              <a href="<%=MM_moveLast%>"><img src="Last.gif" border=0></a>
              <% End If ' end Not MM_atTotal %> </td>
            <td width="23%" align="center"><script language="Javascript">
function printit(){  
if (window.print) {
    window.print() ;  
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
}
}
</script> <script language="Javascript">  
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
    document.write('<form><input type=button value="Print" name="Print" onClick="printit()"></form>');        
}
</script></td>
          </tr>
        </table>
            <% if session("A") = 1 then %>
        <a href="administering_buildings.asp?A=0&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Submit=Go" class="mainlink">HIDE Assignments Column</a>
            <% else %>
        <a href="administering_buildings.asp?A=1&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Submit=Go" class="mainlink">SHOW Assignments Column</a></div></td>
  <%end if%>
</tr>
</table>
<table border="1" width="100%">
  <tr class="tblue">
    <td>
      <div align="center"><strong>ID</strong></div></td>
    <td>
      <div align="center"><a href="administering_buildings.asp?A=<%=session("A")%>&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Sortby=SubmitDate"><strong>Submitted</strong></a></div></td>
    <td>
      <div align="center"><a href="administering_buildings.asp?A=<%=session("A")%>&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Sortby=EmailAddress"><strong>User
        Email</strong></a></div></td>
    <td><a href="administering_buildings.asp?A=<%=session("A")%>&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Sortby=building">Building</a></td>
    <td>
      <div align="center"><strong>Room #</strong></div></td>
    <td>
      <div align="center"><strong>Machine</strong></div></td>
    <td><a href="administering_buildings.asp?A=<%=session("A")%>&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Sortby=Priority">Priority</a></td>
    <td>
      <div align="center"><a href="administering_buildings.asp?A=<%=session("A")%>&building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Sortby=ChooseProblem"><strong>Category</strong></a></div></td>
    <td><strong>Problem Statement</strong></td>
   <% if session("A") = 1 then %> <td>
      <div align="center">Assignment Info. </div></td>
        <%else
        end if%>
  </tr>
  <%
While ((Repeat1__numRows <> 0) AND (NOT rs_all_requests_yet_filtered.EOF))
%>
<%building=(rs_all_requests_yet_filtered.Fields.Item("Building").Value)%>
  <tr bgcolor="<%=bgcolor%>">
    <td class="bct"><%=(rs_all_requests_yet_filtered.Fields.Item("servicerequestID").Value)%></td>
    <td class="bct"><%=(rs_all_requests_yet_filtered.Fields.Item("SubmitDate").Value)%></td>
    <td nowrap><p><a href="mailto:<%=(rs_all_requests_yet_filtered.Fields.Item("EmailAddress").Value)%>" class="bct"><%emailAddress=(rs_all_requests_yet_filtered.Fields.Item("EmailAddress").Value)
      response.write emailAddress  %></a></p></td>
    <td class="bct"><%=building%></td>
    <td class="bct"><%=(rs_all_requests_yet_filtered.Fields.Item("RoomNumber").Value)%></td>
    <td class="bct"><%=(rs_all_requests_yet_filtered.Fields.Item("Machine").Value)%></td>
    <td class="bct" nowrap><span class="boldRed"><strong><% if (rs_all_requests_yet_filtered.Fields.Item("Priority").Value) = 5 then
      response.Write("U")
      else
      response.Write(rs_all_requests_yet_filtered.Fields.Item("Priority").Value)
      end if
      %></strong></span><strong> (<a href="changePriorityScript.asp?newPriority=1&ServiceRequestID=<%= (rs_all_requests_yet_filtered.Fields.Item("ServiceRequestID").Value)%>&A=<%=request.querystring("A")%>&building=<%=request.querystring("building")%>&closedorpending=<%=request.querystring("closedorpending")%>&Sortby=Priority">1</a>) (<a href="changePriorityScript.asp?newPriority=2&ServiceRequestID=<%= (rs_all_requests_yet_filtered.Fields.Item("ServiceRequestID").Value)%>&A=<%=request.querystring("A")%>&building=<%=request.querystring("building")%>&closedorpending=<%=request.querystring("closedorpending")%>&Sortby=Priority">2</a>) (<a href="changePriorityScript.asp?newPriority=3&ServiceRequestID=<%= (rs_all_requests_yet_filtered.Fields.Item("ServiceRequestID").Value)%>&A=<%=request.querystring("A")%>&building=<%=request.querystring("building")%>&closedorpending=<%=request.querystring("closedorpending")%>&Sortby=Priority">3</a>) (<a href="changePriorityScript.asp?newPriority=4&ServiceRequestID=<%= (rs_all_requests_yet_filtered.Fields.Item("ServiceRequestID").Value)%>&A=<%=request.querystring("A")%>&building=<%=request.querystring("building")%>&closedorpending=<%=request.querystring("closedorpending")%>&Sortby=Priority">4</a>)</strong></td>
    <td class="bct"><%=(rs_all_requests_yet_filtered.Fields.Item("ChooseProblem").Value)%></td>
    <td><span class="bct">
<%
' count the records for each looped rs's category and display the integer later
sqltemp="select * from techServiceComments where parentID=" & (rs_all_requests_yet_filtered.Fields.Item("servicerequestID").Value)
set rstemp=Server.CreateObject("adodb.Recordset")
rstemp.open sqltemp, MM_conn_itss_STRING, adopenstatic
howmanyrecs=rstemp.recordcount
response.write "<font color=red><b>(" & howmanyrecs & ")</b></font> "
rstemp.close
set rstemp=nothing
%>


      <% sentProblemStatement = (rs_all_requests_yet_filtered.Fields.Item("ProblemStatement").Value)
       response.write sentProblemStatement
        %>
    </span>[<a href="view_edit_pending.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "servicerequestID=" & rs_all_requests_yet_filtered.Fields.Item("servicerequestID").Value %>" class="highlight">VIEW/EDIT</a>]<span class="bct"><font color="#0000CC"> - <font color="#006699" size="1"><%=(rs_all_requests_yet_filtered.Fields.Item("AssignedTo").Value)%></font></font></span> </td>
    <% if session("A") = 1 then %>
     <td><div align="right"><span class="bct">
        </span><br>
        <% if (rs_all_requests_yet_filtered.Fields.Item("AssignedTo").Value) <> "" then%>
        <strong>Currently Assigned to: <span class="boldRed"><%=(rs_all_requests_yet_filtered.Fields.Item("AssignedTo").Value)%></span> <br>
        by <span class="boldGreen"><%=(rs_all_requests_yet_filtered.Fields.Item("assignedToBy").Value)%></span> </strong>
        <% else %>
        <strong>Unassigned</strong>
        <% end if %>
    </div>
      <form name="form1" method="post" action="administering_buildings.asp?building=<%=request.QueryString("building")%>&closedorpending=<%=request.QueryString("closedorpending")%>&Submit=Go">
        <div align="right">Assign this ticket to:
          <input type="hidden" name="ServiceRequestID" value="<%=(rs_all_requests_yet_filtered.Fields.Item("ServiceRequestID").Value)%>">
          <input type="hidden" name="sentProblemStatement" value="<%=sentProblemStatement%>">
              <input type="hidden" name="emailAddress" value="<%=emailAddress%>">
              <input type="hidden" name="building" value="<%=building%>">
<select name="assignedto">
      <option value="">-- Select Tech --</option>
      <%
While (NOT rs_techBoyz.EOF)
%>
      <option value="<%=(rs_techBoyz.Fields.Item("EmailAddress").Value)%>"><%=(rs_techBoyz.Fields.Item("EmailAddress").Value)%></option>
      <%
  rs_techBoyz.MoveNext()
Wend
If (rs_techBoyz.CursorType > 0) Then
  rs_techBoyz.MoveFirst
Else
  rs_techBoyz.Requery
End If
%>
          </select>
          <input type="submit" name="Submit" value="Go">
        </div>
    </form></td>
      <%
      else
      end if
      %>
  </tr>
  <% if bgcolor="" then bgcolor="cccccc" else bgcolor=""%>
  <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rs_all_requests_yet_filtered.MoveNext()
Wend
%>
</table>
</body>
</html>
<%
rs_all_requests_yet_filtered.Close()
%>
<%
rs_techBoyz.Close()
Set rs_techBoyz = Nothing
%>
0
 
LVL 2

Author Comment

by:smetterd
ID: 11820587
I have narrowed it down to the query itself. The code is fine as you and I have found. It seems as though when I loop through the recordset to populate the dropdown list with library personnel, the error occurs. Here's the query:

SELECT *
FROM Staff
WHERE MID([strPermissions], 17, 1) = MMColParam

--------------
And MMColParam is set equal to = Session("blnViewAllReservations")
0
 
LVL 2

Author Comment

by:smetterd
ID: 11820601
Arghhh

I looked at a backup and my old query was changed by DW's GUI tools.

GUI tools can be a pain in the butt.

Thanks for your help, I have solved this issue.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 11826058
Cool.  Glad you figured it out.
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 11875646
Closed, 500 points refunded.
Netminder
Site Admin
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now