home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 April B / Pcwk4b98.iso / ie401gb / IEAK4.CAB / corpform.asp < prev    next >
Text File  |  1997-10-08  |  24KB  |  648 lines

  1. <%@ LANGUAGE="vbscript" %>
  2. <%
  3. '-------------------------------------------------------------------------------
  4. ' Microsoft Visual InterDev - Data Form Wizard
  5. ' Form Page
  6. '
  7. ' (c) 1997 Microsoft Corporation.  All Rights Reserved.
  8. '
  9. ' This file is an Active Server Page that contains the form view of a Data Form. 
  10. ' It requires Microsoft Internet Information Server 3.0 and can be displayed
  11. ' using any browser that supports tables. You can edit this file to further 
  12. ' customize the form view.
  13. '
  14. ' Modes:         The form mode can be controlled by passing the following
  15. '                name/value pairs using POST or GET:
  16. '                FormMode=Edit
  17. '                FormMode=Filter
  18. '                FormMode=New
  19. ' Tips:            - If a field contains a URL to an image and has a name that 
  20. '                begins with "img_" (case-insensitive), the image will be 
  21. '                displayed using the IMG tag.
  22. '                - If a field contains a URL and has a name that begins with 
  23. '                "url_" (case-insensitive), a jump will be displayed using the 
  24. '                Anchor tag.
  25. '-------------------------------------------------------------------------------
  26.  
  27. Dim strPagingMove    
  28. Dim strFormMode
  29. Dim strDFName
  30. strDFName = "rsCorpAdminIEGroup"
  31. %>
  32.  
  33. <SCRIPT RUNAT=Server LANGUAGE="VBScript">
  34.  
  35. '---- FieldAttributeEnum Values ----
  36. Const adFldUpdatable = &H00000004
  37. Const adFldUnknownUpdatable = &H00000008
  38. Const adFldIsNullable = &H00000020
  39.  
  40. '---- DataTypeEnum Values ----
  41. Const adUnsignedTinyInt = 17
  42. Const adBoolean = 11
  43. Const adLongVarChar = 201
  44. Const adLongVarWChar = 203
  45. Const adBinary = 128
  46. Const adVarBinary = 204
  47. Const adLongVarBinary = 205
  48. Const adVarChar = 200
  49. Const adWVarChar = 202
  50. Const adBSTR = 8
  51. Const adChar = 129
  52. Const adWChar = 130
  53. '---- Other Values ----
  54. Const dfMaxSize = 100
  55.  
  56. '-------------------------------------------------------------------------------
  57. ' Purpose:  Substitutes Empty for Null and trims leading/trailing spaces
  58. ' Inputs:   varTemp    - the target value
  59. ' Returns:    The processed value
  60. '-------------------------------------------------------------------------------
  61.  
  62. Function ConvertNull(varTemp)
  63.     If IsNull(varTemp) Then
  64.         ConvertNull = ""
  65.     Else
  66.         ConvertNull = Trim(varTemp)
  67.     End If
  68. End Function
  69.  
  70. '-------------------------------------------------------------------------------
  71. ' Purpose:  Embeds bracketing quotes around the string
  72. ' Inputs:   varTemp    - the target value
  73. ' Returns:    The processed value
  74. '-------------------------------------------------------------------------------
  75.  
  76. Function QuotedString(varTemp)
  77.     If IsNull(varTemp) Then
  78.         QuotedString = Chr(34) & Chr(34)
  79.     Else
  80.         QuotedString = Chr(34) & CStr(varTemp) & Chr(34)
  81.     End If
  82. End Function
  83.  
  84. '-------------------------------------------------------------------------------
  85. ' Purpose:  Tests string to see if it is a URL by looking for protocol
  86. ' Inputs:   varTemp    - the target value
  87. ' Returns:    True - if is URL, False if not
  88. '-------------------------------------------------------------------------------
  89.  
  90. Function IsURL(varTemp)
  91.     IsURL = True
  92.     If UCase(Left(Trim(varTemp), 6)) = "HTTP:/" Then Exit Function
  93.     If UCase(Left(Trim(varTemp), 6)) = "FILE:/" Then Exit Function
  94.     If UCase(Left(Trim(varTemp), 8)) = "MAILTO:/" Then Exit Function
  95.     If UCase(Left(Trim(varTemp), 5)) = "FTP:/" Then Exit Function
  96.     If UCase(Left(Trim(varTemp), 8)) = "GOPHER:/" Then Exit Function
  97.     If UCase(Left(Trim(varTemp), 6)) = "NEWS:/" Then Exit Function
  98.     If UCase(Left(Trim(varTemp), 7)) = "HTTPS:/" Then Exit Function
  99.     If UCase(Left(Trim(varTemp), 8)) = "TELNET:/" Then Exit Function
  100.     If UCase(Left(Trim(varTemp), 6)) = "NNTP:/" Then Exit Function
  101.     IsURL = False
  102. End Function
  103.  
  104. '-------------------------------------------------------------------------------
  105. ' Purpose:  Tests whether the field in the recordset is updatable
  106. ' Assumes:     That the recordset containing the field is open
  107. ' Inputs:   strFieldName    - the name of the field in the recordset
  108. ' Returns:    True if updatable, False if not
  109. '-------------------------------------------------------------------------------
  110.  
  111. Function CanUpdateField(strFieldName)
  112.     Dim intUpdatable
  113.     intUpdatable = (adFldUpdatable Or adFldUnknownUpdatable)
  114.     CanUpdateField = True
  115.     If (rsCorpAdminIEGroup(strFieldName).Attributes And intUpdatable) = False Then
  116.         CanUpdateField = False
  117.     End If
  118. End Function
  119.  
  120. '-------------------------------------------------------------------------------
  121. ' Purpose:  Handles the display of a field from a recordset depending
  122. '            on its data type, attributes, and the current mode.
  123. ' Assumes:     That the recordset containing the field is open
  124. '            That strFormMode is initialized
  125. ' Inputs:   strFieldName     - the name of the field in the recordset
  126. '            strLabel        - the label to display
  127. '            blnIdentity        - identity field flag
  128. '            avarLookup        - array of lookup values
  129. '-------------------------------------------------------------------------------
  130.  
  131. Sub ShowField(strFieldName, strLabel, blnIdentity, avarLookup)
  132.     Dim blnFieldRequired
  133.     Dim intMaxSize
  134.     Dim intInputSize
  135.     Dim strOption1State
  136.     Dim strOption2State
  137.     Dim strFieldValue
  138.     Dim nPos
  139.     strFieldValue = ""
  140.     nPos=Instr(strFieldName,".")
  141.     Do While nPos > 0 
  142.         strFieldName= Mid (strFieldName, nPos+1)
  143.         nPos=Instr(strFieldName,".")
  144.     Loop 
  145.     ' If not in Edit form mode then set value to empty so doesn't display
  146.     strFieldValue = ""
  147.     If strFormMode = "Edit" Then strFieldValue = RTrim(rsCorpAdminIEGroup(strFieldName))
  148.     
  149.     ' See if the field is required by checking the attributes 
  150.     blnFieldRequired = False
  151.     If (rsCorpAdminIEGroup(strFieldName).Attributes And adFldIsNullable) = 0 Then 
  152.         blnFieldRequired = True
  153.     End If
  154.     
  155.     ' Set values for the MaxLength and Size attributes    
  156.     intMaxSize = dfMaxSize
  157.     intInputSize = rsCorpAdminIEGroup(strFieldName).DefinedSize + 2
  158.     If strFormMode <> "Filter" Then intMaxSize = intInputSize - 2
  159.     
  160.     ' Write the field label and start the value cell
  161.     Response.Write "<TR VALIGN=TOP>"
  162.     Response.Write "<TD HEIGHT=25 ALIGN=Left NOWRAP><FONT SIZE=-1><B>  " & strLabel & "</B></FONT></TD>"    
  163.     Response.Write "<TD WIDTH=100% ><FONT SIZE=-1>"
  164.     
  165.     ' If the field is not updatable, then handle 
  166.     ' it like an Identity column and exit
  167.     If Not CanUpdateField(strFieldName) Then
  168.         ' Special handling if Binary
  169.         Select Case rsCorpAdminIEGroup(strFieldName).Type
  170.             Case adBinary, adVarBinary, adLongVarBinary        'Binary
  171.                 Response.Write "[Binary]"
  172.             Case Else        
  173.                 Select Case strFormMode
  174.                     Case "Edit"
  175.                         Response.Write ConvertNull(strFieldValue)
  176.                         Response.Write "<INPUT TYPE=Hidden NAME=" & QuotedString(strFieldName)
  177.                         Response.Write " VALUE=" & QuotedString(strFieldValue) & " >"
  178.                     Case "New"
  179.                         Response.Write "[AutoNumber]"
  180.                         Response.Write "<INPUT TYPE=Hidden NAME=" & QuotedString(strFieldName)
  181.                         Response.Write " VALUE=" & QuotedString(strFieldValue) & " >"
  182.                     Case "Filter" 
  183.                         Response.Write "<INPUT TYPE=Text NAME=" & QuotedString(strFieldName)
  184.                         Response.Write " SIZE=" & intInputSize
  185.                         Response.Write " MAXLENGTH=" & intMaxSize
  186.                         Response.Write " VALUE=" & QuotedString(strFieldValue) & " >"
  187.                 End Select
  188.         End Select
  189.         Response.Write "</FONT></TD></TR>"
  190.         Exit Sub
  191.     End If
  192.     
  193.     ' Handle lookups using a select and options
  194.     If Not IsNull(avarLookup) Then
  195.         Response.Write "<SELECT NAME=" & QuotedString(strFieldName) & ">"
  196.         ' Add blank entry if not required or in filter mode
  197.         If Not blnFieldRequired Or strFormMode = "Filter" Then
  198.             If (strFormMode = "Filter" Or strFormMode = "New") Then
  199.                 Response.Write "<OPTION SELECTED>"
  200.             Else
  201.                 Response.Write "<OPTION>"
  202.             End If
  203.         End If
  204.         
  205.         ' Loop thru the rows in the array
  206.         For intRow = 0 to UBound(avarLookup, 2)
  207.             Response.Write "<OPTION VALUE=" & QuotedString(avarLookup(0, intRow))
  208.             If strFormMode = "Edit" Then
  209.                 If ConvertNull(avarLookup(0, intRow)) = ConvertNull(strFieldValue) Then
  210.                        Response.Write " SELECTED"
  211.                 End If
  212.             End If
  213.                Response.Write ">"
  214.             Response.Write ConvertNull(avarLookup(1, intRow))
  215.         Next
  216.         Response.Write "</SELECT>"
  217.         If blnFieldRequired And strFormMode = "New" Then 
  218.             Response.Write "  Required"
  219.         End If
  220.         Response.Write "</FONT></TD></TR>"
  221.         Exit Sub
  222.     End If    
  223.     
  224.     ' Evaluate data type and handle appropriately
  225.     Select Case rsCorpAdminIEGroup(strFieldName).Type
  226.     
  227.         Case adBoolean, adUnsignedTinyInt                'Boolean
  228.             If strFormMode = "Filter" Then                
  229.                 strOption1State = " >True"
  230.                 strOption2State = " >False"
  231.             Else
  232.                 Select Case strFieldValue
  233.                     Case "True", "1", "-1"
  234.                         strOption1State = " CHECKED>True"
  235.                         strOption2State = " >False"
  236.                     Case "False", "0"
  237.                         strOption1State = " >True"
  238.                         strOption2State = " CHECKED>False"
  239.                     Case Else
  240.                         strOption1State = " >True"
  241.                         strOption2State = " >False"
  242.                 End Select
  243.             End If            
  244.             Response.Write "<INPUT TYPE=Radio VALUE=1 NAME=" & QuotedString(strFieldName) & strOption1State
  245.             Response.Write "<INPUT TYPE=Radio VALUE=0 NAME=" & QuotedString(strFieldName) & strOption2State
  246.             If strFormMode = "Filter" Then
  247.                 Response.Write "<INPUT TYPE=Radio NAME=" & QuotedString(strFieldName) & " CHECKED>Neither"
  248.             End If
  249.             
  250.         Case adBinary, adVarBinary, adLongVarBinary        'Binary
  251.             Response.Write "[Binary]"
  252.             
  253.         Case adLongVarChar, adLongVarWChar                'Memo
  254.             Response.Write "<TEXTAREA NAME=" & QuotedString(strFieldName) & " ROWS=3 COLS=80>"
  255.             Response.Write Server.HTMLEncode(ConvertNull(strFieldValue))
  256.             Response.Write "</TEXTAREA>"
  257.             
  258.         Case Else
  259.             Dim nType 
  260.             nType=rsCorpAdminIEGroup(strFieldName).Type
  261.             If (nType <> adVarChar) and (nType <> adWVarChar) and (nType <> adBSTR) and (nType <> adChar) and (nType <> adWChar)  Then
  262.                 intInputSize = (intInputSize-2)*3+2
  263.                 If strFormMode <> "Filter" Then intMaxSize = intInputSize - 2
  264.             End If
  265.             If blnIdentity Then
  266.                 Select Case strFormMode
  267.                     Case "Edit"
  268.                         Response.Write ConvertNull(strFieldValue)
  269.                         Response.Write "<INPUT TYPE=Hidden NAME=" & QuotedString(strFieldName)
  270.                         Response.Write " VALUE=" & QuotedString(strFieldValue) & " >"
  271.                     Case "New"
  272.                         Response.Write "[AutoNumber]"
  273.                         Response.Write "<INPUT TYPE=Hidden NAME=" & QuotedString(strFieldName)
  274.                         Response.Write " VALUE=" & QuotedString(strFieldValue) & " >"
  275.                     Case "Filter" 
  276.                         Response.Write "<INPUT TYPE=Text NAME=" & QuotedString(strFieldName) & " SIZE=" & tInputSize
  277.                         Response.Write " MAXLENGTH=" & tMaxSize & " VALUE=" & QuotedString(strFieldValue) & " >"
  278.                 End Select
  279.             Else
  280.                 If intInputSize > 80 Then intInputSize = 80            
  281.                 Response.Write "<INPUT TYPE=Text NAME=" & QuotedString(strFieldName)
  282.                 Response.Write " SIZE=" & intInputSize
  283.                 Response.Write " MAXLENGTH=" & intMaxSize
  284.                 Response.Write " VALUE=" & QuotedString(strFieldValue) & " >"
  285.                 ' Check for special field types
  286.                 Select Case UCase(Left(rsCorpAdminIEGroup(strFieldName).Name, 4))
  287.                     Case "IMG_"
  288.                         If strFieldValue <> "" Then
  289.                             Response.Write "<BR><BR><IMG SRC=" & QuotedString(strFieldValue) & "><BR> <BR>"
  290.                         End If
  291.                     Case "URL_"
  292.                         If strFieldValue <> "" Then
  293.                             Response.Write "  <A HREF=" & QuotedString(strFieldValue) & ">"
  294.                             Response.Write "Go"
  295.                             Response.Write "</A>"
  296.                         End If
  297.                     Case Else
  298.                         If IsURL(strFieldValue) Then
  299.                             Response.Write "  <A HREF=" & QuotedString(strFieldValue) & ">"
  300.                             Response.Write "Go"
  301.                             Response.Write "</A>"
  302.                         End If                    
  303.                 End Select                
  304.             End If
  305.     End Select
  306.        If blnFieldRequired And strFormMode = "New" Then
  307.         Response.Write "  Required"
  308.     End If
  309.     Response.Write "</FONT></TD></TR>"
  310. End Sub    
  311. </SCRIPT>
  312.  
  313. <% 
  314. strFormMode = "Edit"    ' Initalize the default
  315. If Not IsEmpty(Request("FormMode")) Then strFormMode = Request("FormMode")
  316. If Not IsEmpty(Request("rsCorpAdminIEGroup_PagingMove")) Then
  317.     strPagingMove = Trim(Request("rsCorpAdminIEGroup_PagingMove"))
  318. End If
  319. %>
  320.  
  321. <HTML>
  322. <HEAD>
  323.     <META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev">
  324.     <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
  325.     <META NAME="Keywords" CONTENT="Microsoft Data Form, IEAK CorpAdmin Form">
  326.     <TITLE>IEAK CorpAdmin Form</TITLE>
  327. </HEAD>
  328.  
  329. <!--------------------------- Formatting Section ------------------------------>
  330.  
  331. <BASEFONT FACE="Arial, Helvetica, sans-serif">
  332. <LINK REL=STYLESHEET HREF="./Stylesheets/Grid/Style2.css">
  333. <BODY BACKGROUND="./Images/Grid/Background/Back2.jpg" BGCOLOR=White>
  334.  
  335. <!---------------------------- Lookups Section -------------------------------->
  336.  
  337. <!---------------------------- Heading Section -------------------------------->
  338.  
  339. <% Response.Write "<FORM ACTION=""CorpAdminAction.asp"" METHOD=""POST"">" %>
  340. <TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=0>
  341.     <TR>
  342.         <TH NOWRAP BGCOLOR=Silver BACKGROUND="./Images/Grid/Navigation/Nav1.jpg">
  343.             <FONT SIZE=6> IEAK CorpAdmin </FONT>
  344.         </TH>
  345.         <TD ALIGN=Right BGCOLOR=Silver VALIGN=MIDDLE WIDTH=100% BACKGROUND="./Images/Grid/Navigation/Nav1.jpg">
  346.             <% 
  347.             If strFormMode = "Form View" then strFormMode = "Edit"
  348.             Select Case strFormMode
  349.                 Case "Edit"    
  350.                     %>
  351.                     <INPUT TYPE="SUBMIT" NAME="DataAction" VALUE="Update">
  352.                     <INPUT TYPE="SUBMIT" NAME="DataAction" VALUE="Delete">
  353.                     <INPUT TYPE="SUBMIT" NAME="DataAction" VALUE="New">
  354.                     <INPUT TYPE="SUBMIT" NAME="DataAction" VALUE="Filter">
  355.                     <% If Session("rsCorpAdminIEGroup_Filter") <> "" Then %>
  356.                           <INPUT TYPE="SUBMIT" NAME="DataAction" VALUE="All Records">
  357.                     <% End If %> 
  358.                 <% Case "Filter" %>
  359.                     <INPUT TYPE="SUBMIT" NAME="DataAction" VALUE=" Apply ">
  360.                     <INPUT TYPE="SUBMIT" NAME="DataAction" VALUE=" Cancel "> 
  361.                 <% Case "New" %>
  362.                     <INPUT TYPE="SUBMIT" NAME="DataAction" VALUE=" Insert ">
  363.                     <INPUT TYPE="SUBMIT" NAME="DataAction" VALUE=" Cancel "> 
  364.             <% End Select %>
  365.              <INPUT TYPE="SUBMIT" NAME="DataAction" VALUE="List View">         
  366.         </TD>
  367.     </TR>
  368.     <TR>
  369.         <TD BGCOLOR=#FFFFCC COLSPAN=3>
  370.             <FONT SIZE=-1>  
  371.             <%
  372.             If Not IsEmpty(Session("rsCorpAdminIEGroup_Status")) And Session("rsCorpAdminIEGroup_Status") <>"" Then
  373.                 Response.Write Session("rsCorpAdminIEGroup_Status")
  374.                 Session("rsCorpAdminIEGroup_Status") = ""
  375.             Else
  376.                 Select Case strFormMode
  377.                     Case "Edit"
  378.                         If IsEmpty(Session("rsCorpAdminIEGroup_Filter")) Then
  379.                             Response.Write "Current Filter: None"
  380.                         Else
  381.                             If Session("rsCorpAdminIEGroup_Filter") <> "" Then
  382.                                 Response.Write "Current Filter: " & Session("rsCorpAdminIEGroup_FilterDisplay")
  383.                             Else
  384.                                 Response.Write "Current Filter: None"
  385.                             End If
  386.                         End If
  387.                     Case "Filter"
  388.                         Response.Write "Status: Ready for filter criteria"
  389.                     Case "New"
  390.                         Response.Write "Status: Ready for new record"
  391.                 End Select
  392.             End If 
  393.             %>
  394.             </FONT>
  395.         </TD>
  396.     </TR></TABLE>
  397.  
  398. <!----------------------------- Form Section ---------------------------------->
  399.  
  400. <!--METADATA TYPE="DesignerControl" startspan
  401.     <OBJECT ID="rsCorpAdminIEGroup" WIDTH=151 HEIGHT=24
  402.         CLASSID="CLSID:F602E721-A281-11CF-A5B7-0080C73AAC7E">
  403.         <PARAM NAME="BarAlignment" VALUE="0">
  404.            <PARAM NAME="PageSize" VALUE="1">
  405.         <PARAM Name="RangeType" Value="1">
  406.         <PARAM Name="DataConnection" Value="DataConn">
  407.         <PARAM Name="CommandType" Value="0">
  408.         <PARAM Name="CommandText" Value="SELECT `GroupID`, `GroupName`, `INSFile` FROM `IEGroup`">
  409.         <PARAM Name="CursorType" Value="1">
  410.         <PARAM Name="LockType" Value="3">
  411.         <PARAM Name="CacheRecordset" Value="1">
  412.     </OBJECT>
  413. -->
  414.  
  415. <%
  416. fHideNavBar = False
  417. fHideNumber = False
  418. fHideRequery = False
  419. fHideRule = False
  420. stQueryString = ""
  421. fEmptyRecordset = False
  422. fFirstPass = True
  423. fNeedRecordset = False
  424. fNoRecordset = False
  425. tBarAlignment = "Left"
  426. tHeaderName = "rsCorpAdminIEGroup"
  427. tPageSize = 1
  428. tPagingMove = ""
  429. tRangeType = "Form"
  430. tRecordsProcessed = 0
  431. tPrevAbsolutePage = 0
  432. intCurPos = 0
  433. intNewPos = 0
  434. fSupportsBookmarks = True
  435. fMoveAbsolute = False
  436.  
  437. If Not IsEmpty(Request("rsCorpAdminIEGroup_PagingMove")) Then
  438.     tPagingMove = Trim(Request("rsCorpAdminIEGroup_PagingMove"))
  439. End If
  440.  
  441. If IsEmpty(Session("rsCorpAdminIEGroup_Recordset")) Then
  442.     fNeedRecordset = True
  443. Else
  444.     If Session("rsCorpAdminIEGroup_Recordset") Is Nothing Then
  445.         fNeedRecordset = True
  446.     Else
  447.         Set rsCorpAdminIEGroup = Session("rsCorpAdminIEGroup_Recordset")
  448.     End If
  449. End If
  450.  
  451. If fNeedRecordset Then
  452.     Set DataConn = Server.CreateObject("ADODB.Connection")
  453.     DataConn.ConnectionTimeout = Session("DataConn_ConnectionTimeout")
  454.     DataConn.CommandTimeout = Session("DataConn_CommandTimeout")
  455.     DataConn.Open Session("DataConn_ConnectionString"), Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword")
  456.     Set cmdTemp = Server.CreateObject("ADODB.Command")
  457.     Set rsCorpAdminIEGroup = Server.CreateObject("ADODB.Recordset")
  458.     cmdTemp.CommandText = "SELECT `GroupID`, `GroupName`, `INSFile` FROM `IEGroup`"
  459.     cmdTemp.CommandType = 1
  460.     Set cmdTemp.ActiveConnection = DataConn
  461.     rsCorpAdminIEGroup.Open cmdTemp, , 1, 3
  462. End If
  463. On Error Resume Next
  464. If rsCorpAdminIEGroup.BOF And rsCorpAdminIEGroup.EOF Then fEmptyRecordset = True
  465. On Error Goto 0
  466. If Err Then fEmptyRecordset = True
  467. If fNeedRecordset Then
  468.     Set Session("rsCorpAdminIEGroup_Recordset") = rsCorpAdminIEGroup
  469. End If
  470. rsCorpAdminIEGroup.PageSize = tPageSize
  471. fSupportsBookmarks = rsCorpAdminIEGroup.Supports(8192)
  472.  
  473. If Not IsEmpty(Session("rsCorpAdminIEGroup_Filter")) And Not fEmptyRecordset Then
  474.     rsCorpAdminIEGroup.Filter = Session("rsCorpAdminIEGroup_Filter")
  475.     If rsCorpAdminIEGroup.BOF And rsCorpAdminIEGroup.EOF Then fEmptyRecordset = True
  476. End If
  477.  
  478. If IsEmpty(Session("rsCorpAdminIEGroup_PageSize")) Then Session("rsCorpAdminIEGroup_PageSize") = tPageSize
  479. If IsEmpty(Session("rsCorpAdminIEGroup_AbsolutePage")) Then Session("rsCorpAdminIEGroup_AbsolutePage") = 1
  480.  
  481. If Session("rsCorpAdminIEGroup_PageSize") <> tPageSize Then
  482.     tCurRec = ((Session("rsCorpAdminIEGroup_AbsolutePage") - 1) * Session("rsCorpAdminIEGroup_PageSize")) + 1
  483.     tNewPage = Int(tCurRec / tPageSize)
  484.     If tCurRec Mod tPageSize <> 0 Then
  485.         tNewPage = tNewPage + 1
  486.     End If
  487.     If tNewPage = 0 Then tNewPage = 1
  488.     Session("rsCorpAdminIEGroup_PageSize") = tPageSize
  489.     Session("rsCorpAdminIEGroup_AbsolutePage") = tNewPage
  490. End If
  491.  
  492. If fEmptyRecordset Then
  493.     fHideNavBar = True
  494.     fHideRule = True
  495. Else
  496.     tPrevAbsolutePage = Session("rsCorpAdminIEGroup_AbsolutePage")
  497.     Select Case tPagingMove
  498.         Case ""
  499.             fMoveAbsolute = True
  500.         Case "Requery"
  501.             rsCorpAdminIEGroup.Requery
  502.             fMoveAbsolute = True
  503.         Case "<<"
  504.             Session("rsCorpAdminIEGroup_AbsolutePage") = 1
  505.         Case "<"
  506.             If Session("rsCorpAdminIEGroup_AbsolutePage") > 1 Then
  507.                 Session("rsCorpAdminIEGroup_AbsolutePage") = Session("rsCorpAdminIEGroup_AbsolutePage") - 1
  508.             End If
  509.         Case ">"
  510.             If Not rsCorpAdminIEGroup.EOF Then
  511.                 Session("rsCorpAdminIEGroup_AbsolutePage") = Session("rsCorpAdminIEGroup_AbsolutePage") + 1
  512.             End If
  513.         Case ">>"
  514.             If fSupportsBookmarks Then
  515.                 Session("rsCorpAdminIEGroup_AbsolutePage") = rsCorpAdminIEGroup.PageCount
  516.             End If
  517.     End Select
  518.     Do
  519.         If fSupportsBookmarks Then
  520.             rsCorpAdminIEGroup.AbsolutePage = Session("rsCorpAdminIEGroup_AbsolutePage")
  521.         Else
  522.             If fNeedRecordset Or fMoveAbsolute Or rsCorpAdminIEGroup.EOF Then
  523.                 rsCorpAdminIEGroup.MoveFirst
  524.                 rsCorpAdminIEGroup.Move (Session("rsCorpAdminIEGroup_AbsolutePage") - 1) * tPageSize
  525.             Else
  526.                 intCurPos = ((tPrevAbsolutePage - 1) * tPageSize) + tPageSize
  527.                 intNewPos = ((Session("rsCorpAdminIEGroup_AbsolutePage") - 1) * tPageSize) + 1
  528.                 rsCorpAdminIEGroup.Move intNewPos - intCurPos
  529.             End If
  530.             If rsCorpAdminIEGroup.BOF Then rsCorpAdminIEGroup.MoveNext
  531.         End If
  532.         If Not rsCorpAdminIEGroup.EOF Then Exit Do
  533.         Session("rsCorpAdminIEGroup_AbsolutePage") = Session("rsCorpAdminIEGroup_AbsolutePage") - 1
  534.     Loop
  535. End If
  536.  
  537. Do
  538.     If fEmptyRecordset Then Exit Do
  539.     If tRecordsProcessed = tPageSize Then Exit Do
  540.     If Not fFirstPass Then
  541.         rsCorpAdminIEGroup.MoveNext
  542.     Else
  543.         fFirstPass = False
  544.     End If
  545.     If rsCorpAdminIEGroup.EOF Then Exit Do
  546.     tRecordsProcessed = tRecordsProcessed + 1
  547. %>
  548. <!--METADATA TYPE="DesignerControl" endspan-->
  549.  
  550. <% 
  551. If strFormMode = "Edit" Then
  552.     Response.Write "<P>"
  553.     Response.Write "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0>"
  554.     ShowField "GroupID", "GroupID", True, Null
  555.     ShowField "GroupName", "GroupName", False, Null
  556.     ShowField "INSFile", "INSFile", False, Null
  557.     Response.Write "</TABLE>"
  558.     Response.Write "</FORM></P>"
  559.     stQueryString = "?FormMode=Edit"
  560.     fHideNavBar = False
  561.     fHideRule = True
  562. Else
  563.     fHideNavBar = True
  564.     fHideRule = True
  565. End If 
  566. %>
  567.  
  568. <!--METADATA TYPE="DesignerControl" startspan
  569.     <OBJECT ID="DataRangeFtr1" WIDTH=151 HEIGHT=24
  570.         CLASSID="CLSID:F602E722-A281-11CF-A5B7-0080C73AAC7E">
  571.     </OBJECT>
  572. -->
  573. <%
  574. Loop
  575. If tRangeType = "Table" Then Response.Write "</TABLE>"
  576. If tPageSize > 0 Then
  577.     If Not fHideRule Then Response.Write "<HR>"
  578.     If Not fHideNavBar Then
  579.         %>
  580.         <TABLE WIDTH=100% >
  581.         <TR>
  582.             <TD WIDTH=100% >
  583.                 <P ALIGN=<%= tBarAlignment %> >
  584.                 <FORM <%= "ACTION=""" & Request.ServerVariables("PATH_INFO") & stQueryString & """" %> METHOD="POST">
  585.                     <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="   <<   ">
  586.                     <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="   <    ">
  587.                     <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="    >   ">
  588.                     <% If fSupportsBookmarks Then %>
  589.                         <INPUT TYPE="Submit" NAME="<%= tHeaderName & "_PagingMove" %>" VALUE="   >>   ">
  590.                     <% End If %>
  591.                     <% If Not fHideRequery Then %>
  592.                         <INPUT TYPE="Submit" NAME="<% =tHeaderName & "_PagingMove" %>" VALUE=" Requery ">
  593.                     <% End If %>
  594.                 </FORM>
  595.                 </P>
  596.             </TD>
  597.             <TD VALIGN=MIDDLE ALIGN=RIGHT>
  598.                 <FONT SIZE=2>
  599.                 <%
  600.                 If Not fHideNumber Then
  601.                     If tPageSize > 1 Then
  602.                         Response.Write "<NOBR>Page: " & Session(tHeaderName & "_AbsolutePage") & "</NOBR>"
  603.                     Else
  604.                         Response.Write "<NOBR>Record: " & Session(tHeaderName & "_AbsolutePage") & "</NOBR>"
  605.                     End If
  606.                 End If
  607.                 %>
  608.                 </FONT>
  609.             </TD>
  610.         </TR>
  611.         </TABLE>
  612.     <%
  613.     End If
  614. End If
  615. %>
  616. <!--METADATA TYPE="DesignerControl" endspan-->
  617.  
  618. <% 
  619. If strFormMode <> "Edit" Then
  620.     Response.Write "<P>"
  621.     Response.Write "<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0>"
  622.     ShowField "GroupID", "GroupID", True, Null
  623.     ShowField "GroupName", "GroupName", False, Null
  624.     ShowField "INSFile", "INSFile", False, Null
  625.     Response.Write "</TABLE>"
  626.     Response.Write "</FORM></P>"    
  627. End If
  628. %>
  629.  
  630. <!---------------------------- Footer Section --------------------------------->
  631.  
  632. <%
  633. ' Display a message if there are no records to show
  634. If strFormMode = "Edit" And fEmptyRecordset Then
  635.     Response.Write "<p align=left>No Records Available</p>"
  636. End If
  637. ' TEMP: This is here until we get a drop of the data range that has
  638. '         the CacheRecordset property  
  639. If fNeedRecordset Then
  640.     Set Session("rsCorpAdminIEGroup_Recordset") = rsCorpAdminIEGroup
  641. End If
  642. %>
  643.  
  644. </BODY>
  645. </HTML>
  646.  
  647.