home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / certsrv.cab / wcqacton.asp < prev    next >
Encoding:
Text File  |  1997-08-25  |  21.2 KB  |  662 lines

  1. <%@ LANGUAGE="VBScript" %>
  2. <%
  3. '-------------------------------------------------------------------------------
  4. ' Microsoft Visual InterDev - Data Form Wizard
  5. ' Action Page
  6. '
  7. ' (c) 1997 Microsoft Corporation.  All Rights Reserved.
  8. '
  9. ' This file is an Active Server Page that contains the server script that 
  10. ' handles filter, update, insert, and delete commands from the form view of a 
  11. ' Data Form. It can also echo back confirmation of database operations and 
  12. ' report errors. Some commands are passed through and redirected. Microsoft 
  13. ' Internet Information Server 3.0 is required.
  14. '
  15. '-------------------------------------------------------------------------------
  16.  
  17. Dim strDFName
  18. Dim strErrorAdditionalInfo
  19. strDFName = "rswcqJoin"
  20. %>
  21.  
  22. <SCRIPT RUNAT=Server LANGUAGE="VBScript">
  23.  
  24. '---- FieldAttributeEnum Values ----
  25. Const adFldUpdatable = &H00000004
  26. Const adFldUnknownUpdatable = &H00000008
  27. Const adFldIsNullable = &H00000020
  28.  
  29. '---- CursorTypeEnum Values ----
  30. Const adOpenForwardOnly = 0
  31. Const adOpenKeyset = 1
  32. Const adOpenDynamic = 2
  33. Const adOpenStatic = 3
  34.  
  35. '---- DataTypeEnum Values ----
  36. Const adUnsignedTinyInt = 17
  37. Const adBoolean = 11
  38. Const adDate = 7
  39. Const adDBDate = 133
  40. Const adDBTimeStamp = 135
  41. Const adBSTR = 8
  42. Const adChar = 129
  43. Const adVarChar = 200
  44. Const adLongVarChar = 201
  45. Const adWChar = 130
  46. Const adVarWChar = 202
  47. Const adLongVarWChar = 203
  48. Const adBinary = 128
  49. Const adVarBinary = 204
  50. Const adLongVarBinary = 205
  51.  
  52. '---- Error Values ----
  53. Const errInvalidPrefix = 20001        'Invalid wildcard prefix
  54. Const errInvalidOperator = 20002    'Invalid filtering operator
  55. Const errInvalidOperatorUse = 20003    'Invalid use of LIKE operator
  56. Const errNotEditable = 20011        'Field not editable
  57. Const errValueRequired = 20012        'Value required
  58.  
  59. '-------------------------------------------------------------------------------
  60. ' Purpose:  Substitutes Null for Empty
  61. ' Inputs:   varTemp    - the target value
  62. ' Returns:    The processed value
  63. '-------------------------------------------------------------------------------
  64.  
  65. Function RestoreNull(varTemp)
  66.     If Trim(varTemp) = "" Then
  67.         RestoreNull = Null
  68.     Else
  69.         RestoreNull = varTemp
  70.     End If
  71. End Function
  72.  
  73. Sub RaiseError(intErrorValue, strFieldName)
  74.     Dim strMsg    
  75.     Select Case intErrorValue
  76.         Case errInvalidPrefix
  77.             strMsg = "Wildcard characters * and % can only be used at the end of the criteria"
  78.         Case errInvalidOperator
  79.             strMsg = "Invalid filtering operators - use <= or >= instead."
  80.         Case errInvalidOperatorUse
  81.             strMsg = "The 'Like' operator can only be used with strings."
  82.         Case errNotEditable
  83.             strMsg = strFieldName & " field is not editable."
  84.         Case errValueRequired
  85.             strMsg = "A value is required for " & strFieldName & "."
  86.     End Select
  87.     Err.Raise intErrorValue, "DataForm", strMsg
  88. End Sub
  89.  
  90. '-------------------------------------------------------------------------------
  91. ' Purpose:  Converts to subtype of string - handles Null cases
  92. ' Inputs:   varTemp    - the target value
  93. ' Returns:    The processed value
  94. '-------------------------------------------------------------------------------
  95.  
  96. Function ConvertToString(varTemp)
  97.     If IsNull(varTemp) Then
  98.         ConvertToString = Null
  99.     Else
  100.         ConvertToString = CStr(varTemp)
  101.     End If
  102. End Function
  103.  
  104. '-------------------------------------------------------------------------------
  105. ' Purpose:  Tests to equality while dealing with Null values
  106. ' Inputs:   varTemp1    - the first value
  107. '            varTemp2    - the second value
  108. ' Returns:    True if equal, False if not
  109. '-------------------------------------------------------------------------------
  110.  
  111. Function IsEqual(ByVal varTemp1, ByVal varTemp2)
  112.     IsEqual = False
  113.     If IsNull(varTemp1) And IsNull(varTemp2) Then
  114.         IsEqual = True
  115.     Else
  116.         If IsNull(varTemp1) Then Exit Function
  117.         If IsNull(varTemp2) Then Exit Function
  118.     End If
  119.     If varTemp1 = varTemp2 Then IsEqual = True
  120. End Function
  121.  
  122. '-------------------------------------------------------------------------------
  123. ' Purpose:  Tests whether the field in the recordset is required
  124. ' Assumes:     That the recordset containing the field is open
  125. ' Inputs:   strFieldName    - the name of the field in the recordset
  126. ' Returns:    True if updatable, False if not
  127. '-------------------------------------------------------------------------------
  128.  
  129. Function IsRequiredField(strFieldName)
  130.     IsRequiredField = False
  131.     If (rswcqJoin(strFieldName).Attributes And adFldIsNullable) = 0 Then 
  132.         IsRequiredField = True
  133.     End If
  134. End Function
  135.  
  136. '-------------------------------------------------------------------------------
  137. ' Purpose:  Tests whether the field in the recordset is updatable
  138. ' Assumes:     That the recordset containing the field is open
  139. ' Effects:    Sets Err object if field is not updatable
  140. ' Inputs:   strFieldName    - the name of the field in the recordset
  141. ' Returns:    True if updatable, False if not
  142. '-------------------------------------------------------------------------------
  143.  
  144. Function CanUpdateField(strFieldName)
  145.     Dim intUpdatable
  146.     intUpdatable = (adFldUpdatable Or adFldUnknownUpdatable)
  147.     CanUpdateField = True
  148.     If (rswcqJoin(strFieldName).Attributes And intUpdatable) = False Then
  149.         CanUpdateField = False
  150.     End If
  151. End Function
  152.  
  153. '-------------------------------------------------------------------------------
  154. ' Purpose:  Insert operation - updates a recordset field with a new value 
  155. '            during an insert operation.
  156. ' Assumes:     That the recordset containing the field is open
  157. ' Effects:    Sets Err object if field is not set but is required
  158. ' Inputs:   strFieldName    - the name of the field in the recordset
  159. ' Returns:    True if successful, False if not
  160. '-------------------------------------------------------------------------------
  161.  
  162. Function InsertField(strFieldName)
  163.     InsertField = True
  164.     If IsEmpty(Request(strFieldName)) Then Exit Function
  165.     Select Case rswcqJoin(strFieldName).Type
  166.          Case adBinary, adVarBinary, adLongVarBinary        'Binary
  167.         Case Else
  168.             If CanUpdateField(strFieldName) Then
  169.                 If IsRequiredField(strFieldName) And IsNull(RestoreNull(Request(strFieldName))) Then
  170.                     RaiseError errValueRequired, strFieldName
  171.                     InsertField = False
  172.                     Exit Function
  173.                 End If                
  174.                 rswcqJoin(strFieldName) = RestoreNull(Request(strFieldName))
  175.             End If
  176.     End Select
  177. End Function
  178.  
  179. '-------------------------------------------------------------------------------
  180. ' Purpose:  Update operation - updates a recordset field with a new value 
  181. ' Assumes:     That the recordset containing the field is open
  182. ' Effects:    Sets Err object if field is not set but is required
  183. ' Inputs:   strFieldName    - the name of the field in the recordset
  184. ' Returns:    True if successful, False if not
  185. '-------------------------------------------------------------------------------
  186.  
  187. Function UpdateField(strFieldName)
  188.     UpdateField = True
  189.     If IsEmpty(Request(strFieldName)) Then Exit Function
  190.     Select Case rswcqJoin(strFieldName).Type
  191.          Case adBinary, adVarBinary, adLongVarBinary        'Binary
  192.         Case Else
  193.             ' Only update if the value has changed
  194.             If Not IsEqual(ConvertToString(rswcqJoin(strFieldName)), RestoreNull(Request(strFieldName))) Then
  195.                 If CanUpdateField(strFieldName) Then                        
  196.                     If IsRequiredField(strFieldName) And IsNull(RestoreNull(Request(strFieldName))) Then
  197.                         RaiseError errValueRequired, strFieldName
  198.                         UpdateField = False
  199.                         Exit Function
  200.                     End If                
  201.                     rswcqJoin(strFieldName) = RestoreNull(Request(strFieldName))
  202.                 Else
  203.                     RaiseError errNotEditable, strFieldName
  204.                     UpdateField = False
  205.                 End If
  206.             End If
  207.     End Select
  208. End Function
  209.  
  210. '-------------------------------------------------------------------------------
  211. ' Purpose:  Criteria handler for a field in the recordset. Determines
  212. '            correct delimiter based on data type
  213. ' Effects:    Appends to strWhere and strWhereDisplay variables
  214. ' Inputs:   strFieldName    - the name of the field in the recordset
  215. '            avarLookup        - lookup array - null if none
  216. '-------------------------------------------------------------------------------
  217.  
  218. Sub FilterField(ByVal strFieldName, avarLookup)
  219.     Dim strFieldDelimiter
  220.     Dim strDisplayValue
  221.     Dim strValue
  222.     Dim intRow
  223.     strValue = Request(strFieldName)
  224.     strDisplayValue = Request(strFieldName)
  225.     
  226.     ' If empty then exit right away
  227.     If Request(strFieldName) = "" Then Exit Sub
  228.     
  229.     ' Concatenate the And boolean operator
  230.     If strWhere <> "" Then strWhere = strWhere & " And"
  231.     If strWhereDisplay <> "" Then strWhereDisplay = strWhereDisplay & " And"
  232.     
  233.     ' If lookup field, then use lookup value for display
  234.     If Not IsNull(avarLookup) Then
  235.         For intRow = 0 to UBound(avarLookup, 2)
  236.             If CStr(avarLookup(0, intRow)) = Request(strFieldName) Then
  237.                 strDisplayValue = avarLookup(1, intRow)
  238.                 Exit For
  239.             End If
  240.         Next
  241.     End If
  242.     
  243.     ' Set delimiter based on data type
  244.     Select Case rswcqJoin(strFieldName).Type
  245.         Case adBSTR, adChar, adWChar, adVarChar, adVarWChar    'string types
  246.             strFieldDelimiter = "'"
  247.         Case adLongVarChar, adLongVarWChar                    'long string types
  248.             strFieldDelimiter = "'"                
  249.         Case adDate, adDBDate, adDBTimeStamp                'date types
  250.             strFieldDelimiter = "#"
  251.         Case Else
  252.             strFieldDelimiter = ""
  253.     End Select
  254.     
  255.     ' Modifies script level variables
  256.     strWhere = strWhere & " " & PrepFilterItem(strFieldName, strValue, strFieldDelimiter)
  257.     strWhereDisplay = strWhereDisplay & " " & PrepFilterItem(strFieldName, strDisplayValue, strFieldDelimiter)
  258.  
  259. End Sub
  260.  
  261. '-------------------------------------------------------------------------------
  262. ' Purpose:  Constructs a name/value pair for a where clause
  263. ' Effects:    Sets Err object if the criteria is invalid
  264. ' Inputs:   strFieldName    - the name of the field in the recordset
  265. '            strCriteria        - the criteria to use
  266. '            strDelimiter    - the proper delimiter to use
  267. ' Returns:    The name/value pair as a string
  268. '-------------------------------------------------------------------------------
  269.  
  270. Function PrepFilterItem(ByVal strFieldName, ByVal strCriteria, ByVal strDelimiter)
  271.     Dim strOperator
  272.     Dim intEndOfWord
  273.     Dim strWord
  274.  
  275.     ' Char, VarChar, and LongVarChar must be single quote delimited.
  276.     ' Dates are pound sign delimited.
  277.     ' Numerics should not be delimited.
  278.     ' String to Date conversion rules are same as VBA.
  279.     ' Only support for ANDing.
  280.     ' Support the LIKE operator but only with * or % as suffix.
  281.     
  282.     strCriteria = Trim(strCriteria)    'remove leading/trailing spaces
  283.     strOperator = "="                'sets default
  284.     strValue = strCriteria            'sets default
  285.  
  286.     ' Get first word and look for operator
  287.     intEndOfWord = InStr(strCriteria, " ")
  288.     If intEndOfWord Then
  289.         strWord = UCase(Left(strCriteria, intEndOfWord - 1))
  290.         ' See if the word is an operator
  291.         Select Case strWord
  292.             Case "=", "<", ">", "<=", ">=",  "<>", "LIKE"
  293.                 strOperator = strWord
  294.                 strValue = Trim(Mid(strCriteria, intEndOfWord + 1))
  295.             Case "=<", "=>"
  296.                 RaiseError errInvalidOperator, strFieldName
  297.         End Select
  298.     Else
  299.         strWord = UCase(Left(strCriteria, 2))
  300.         Select Case strWord
  301.             Case "<=", ">=", "<>"
  302.                 strOperator = strWord
  303.                 strValue = Trim(Mid(strCriteria, 3))
  304.             Case "=<", "=>"
  305.                 RaiseError errInvalidOperator, strFieldName
  306.             Case Else
  307.                 strWord = UCase(Left(strCriteria, 1))
  308.                 Select Case strWord
  309.                     Case "=", "<", ">"
  310.                         strOperator = strWord
  311.                         strValue = Trim(Mid(strCriteria, 2))
  312.                 End Select
  313.         End Select
  314.     End If
  315.  
  316.     ' Make sure LIKE is only used with strings
  317.     If strOperator = "LIKE" and strDelimiter <> "'" Then
  318.         RaiseError errInvalidOperatorUse, strFieldName
  319.     End If        
  320.  
  321.     ' Strip any extraneous delimiters because we add them anyway
  322.     ' Single Quote
  323.     If Left(strValue, 1) = Chr(39) Then strValue = Mid(strValue, 2)
  324.     If Right(strValue, 1) = Chr(39) Then strValue = Left(strValue, Len(strValue) - 1)
  325.  
  326.     ' Double Quote - just in case
  327.     If Left(strValue, 1) = Chr(34) Then strValue = Mid(strValue, 2)
  328.     If Right(strValue, 1) = Chr(34) Then strValue = Left(strValue, Len(strValue) - 1)
  329.  
  330.     ' Pound sign - dates
  331.     If Left(strValue, 1) = Chr(35) Then strValue = Mid(strValue, 2)
  332.     If Right(strValue, 1) = Chr(35) Then strValue = Left(strValue, Len(strValue) - 1)
  333.     
  334.     ' Check for leading wildcards
  335.     If Left(strValue, 1) = "*" Or Left(strValue, 1) = "%" Then
  336.         RaiseError errInvalidPrefix, strFieldName
  337.     End If
  338.     
  339.     PrepFilterItem = "[" & strFieldName & "]" & " " & strOperator & " " & strDelimiter & strValue & strDelimiter
  340. End Function
  341.  
  342. '-------------------------------------------------------------------------------
  343. ' Purpose:  Display field involved in a database operation for feedback.
  344. ' Assumes:     That the recordset containing the field is open
  345. ' Inputs:   strFieldLabel    - the label to be used for the field
  346. '            strFieldName    - the name of the field in the recordset
  347. '-------------------------------------------------------------------------------
  348.  
  349. Sub FeedbackField(strFieldLabel, strFieldName, avarLookup)
  350.     Dim strBool
  351.     Dim intRow
  352.     Response.Write "<TR VALIGN=TOP>"
  353.     Response.Write "<TD ALIGN=Left><FONT SIZE=-1><B>  " & strFieldLabel & "</B></FONT></TD>"
  354.     Response.Write "<TD BGCOLOR=White WIDTH=100% ALIGN=Left><FONT SIZE=-1>"
  355.     
  356.     ' Test for lookup
  357.     If Not IsNull(avarLookup) Then
  358.         For intRow = 0 to UBound(avarLookup, 2)
  359.             If CStr(avarLookup(0, intRow)) = Request(strFieldName) Then
  360.                 Response.Write Server.HTMLEncode(avarLookup(1, intRow))
  361.                 Exit For
  362.             End If
  363.         Next
  364.         Response.Write "</FONT></TD></TR>"
  365.         Exit Sub
  366.     End If
  367.     
  368.     ' Test for empty
  369.     If Request(strFieldName) = "" Then
  370.         Response.Write " "
  371.         Response.Write "</FONT></TD></TR>"
  372.         Exit Sub
  373.     End If
  374.     
  375.     ' Test the data types and display appropriately    
  376.     Select Case rswcqJoin(strFieldName).Type
  377.         Case adBoolean, adUnsignedTinyInt                'Boolean
  378.             strBool = ""
  379.             If Request(strFieldName) <> 0 Then
  380.                 strBool = "True"
  381.             Else
  382.                 strBool = "False"
  383.             End If
  384.             Response.Write strBool
  385.         Case adBinary, adVarBinary, adLongVarBinary        'Binary
  386.             Response.Write "[Binary]"
  387.         Case adLongVarChar, adLongVarWChar                'Memo
  388.             Response.Write Server.HTMLEncode(Request(strFieldName))
  389.         Case Else
  390.             If Not CanUpdateField(strFieldName) Then
  391.                 Response.Write "[AutoNumber]"
  392.             Else
  393.                 Response.Write Server.HTMLEncode(Request(strFieldName))
  394.             End If
  395.     End Select
  396.     Response.Write "</FONT></TD></TR>"
  397. End Sub
  398.  
  399. </SCRIPT>
  400.  
  401.  
  402. <% 
  403. If Not IsEmpty(Request("DataAction")) Then
  404.     strDataAction = Trim(Request("DataAction"))
  405. Else
  406.     Response.Redirect "wcqForm.asp?FormMode=Edit"
  407. End If
  408.  
  409. '------------------
  410. ' Action handler
  411. '------------------
  412. Select Case strDataAction
  413.     
  414.     Case "List View"
  415.         
  416.         Response.Redirect "wcqList.asp"
  417.  
  418.     Case "Cancel"
  419.  
  420.         Response.Redirect "wcqForm.asp?FormMode=Edit"
  421.  
  422.     Case "Filter"
  423.     
  424.         On Error Resume Next
  425.         Session("rswcqJoin_Filter") = ""
  426.         Session("rswcqJoin_FilterDisplay") = ""
  427.         Session("rswcqJoin_Recordset").Filter = ""
  428.         Response.Redirect "wcqForm.asp?FormMode=" & strDataAction
  429.  
  430.     Case "New"
  431.     
  432.         On Error Resume Next
  433.         Session("rswcqJoin_Filter") = ""
  434.         Session("rswcqJoin_FilterDisplay") = ""
  435.         Session("rswcqJoin_Recordset").Filter = ""
  436.         Response.Redirect "wcqForm.asp?FormMode=" & strDataAction
  437.  
  438.     Case "Find"
  439.  
  440.         Session("rswcqJoin_PageSize") = 1 'So we don't do standard page conversion
  441.         Session("rswcqJoin_AbsolutePage") = CLng(Request("Bookmark"))
  442.         Response.Redirect "wcqForm.asp"
  443.  
  444.     Case "All Records"
  445.     
  446.         On Error Resume Next
  447.         Session("rswcqJoin_Filter") = ""
  448.         Session("rswcqJoin_FilterDisplay") = ""
  449.         Session("rswcqJoin_Recordset").Filter = ""
  450.         Session("rswcqJoin_AbsolutePage") = 1
  451.         Response.Redirect "wcqForm.asp"
  452.  
  453.     Case "Apply"
  454.  
  455.         On Error Resume Next
  456.         
  457.         ' Make sure we exit and re-process the form if session has timed out
  458.         If IsEmpty(Session("rswcqJoin_Recordset")) Then
  459.             Response.Redirect "wcqForm.asp?FormMode=Edit"
  460.         End If
  461.         
  462.         Set rswcqJoin = Session("rswcqJoin_Recordset")
  463.  
  464.         strWhere = ""
  465.         strWhereDisplay = ""
  466.         FilterField "RequestID", Null
  467.         
  468.         ' Filter the recordset
  469.         If strWhere <> "" Then
  470.             Session("rswcqJoin_Filter") = strWhere
  471.             Session("rswcqJoin_FilterDisplay") = strWhereDisplay
  472.             Session("rswcqJoin_AbsolutePage") = 1
  473.         Else
  474.             Session("rswcqJoin_Filter") = ""
  475.             Session("rswcqJoin_FilterDisplay") = ""
  476.         End If
  477.  
  478.         ' Jump back to the form
  479.         If Err.Number = 0 Then Response.Redirect "wcqForm.asp"
  480.  
  481.     Case "Insert"
  482.  
  483.         On Error Resume Next        
  484.  
  485.         ' Make sure we exit and re-process the form if session has timed out
  486.         If IsEmpty(Session("rswcqJoin_Recordset")) Then
  487.             Response.Redirect "wcqForm.asp?FormMode=Edit"
  488.         End If
  489.         
  490.         Set rswcqJoin = Session("rswcqJoin_Recordset")
  491.         rswcqJoin.AddNew
  492.         
  493.         Do
  494.             If Not InsertField("RequestID") Then Exit Do
  495.  
  496.             rswcqJoin.Update
  497.             Exit Do
  498.         Loop
  499.  
  500.         If Err.Number <> 0 Then
  501.             If rswcqJoin.EditMode Then rswcqJoin.CancelUpdate
  502.         Else
  503.             If IsEmpty(Session("rswcqJoin_AbsolutePage")) Or Session("rswcqJoin_AbsolutePage") = 0 Then
  504.                 Session("rswcqJoin_AbsolutePage") = 1
  505.             End If
  506.             ' Requery static cursor so inserted record is visible
  507.             If rswcqJoin.CursorType = adOpenStatic Then rswcqJoin.Requery
  508.             Session("rswcqJoin_Status") = "Record has been inserted"
  509.         End If
  510.  
  511.     Case "Update"
  512.  
  513.         On Error Resume Next        
  514.  
  515.         ' Make sure we exit and re-process the form if session has timed out
  516.         If IsEmpty(Session("rswcqJoin_Recordset")) Then
  517.             Response.Redirect "wcqForm.asp?FormMode=Edit"
  518.         End If
  519.         
  520.         Set rswcqJoin = Session("rswcqJoin_Recordset")
  521.         If rswcqJoin.EOF and rswcqJoin.BOF Then Response.Redirect "wcqForm.asp"
  522.         
  523.         Do
  524.  
  525.             If Not UpdateField("RequestID") Then Exit Do
  526.  
  527.             If rswcqJoin.EditMode Then rswcqJoin.Update
  528.             Exit Do
  529.         Loop
  530.  
  531.         If Err.Number <> 0 Then
  532.             If rswcqJoin.EditMode Then rswcqJoin.CancelUpdate
  533.         End If
  534.  
  535.     Case "Delete"
  536.  
  537.         On Error Resume Next
  538.         
  539.         ' Make sure we exit and re-process the form if session has timed out
  540.         If IsEmpty(Session("rswcqJoin_Recordset")) Then
  541.             Response.Redirect "wcqForm.asp?FormMode=Edit"
  542.         End If
  543.         
  544.         Set rswcqJoin = Session("rswcqJoin_Recordset")
  545.         If rswcqJoin.EOF and rswcqJoin.BOF Then Response.Redirect "wcqForm.asp"
  546.         
  547.         rswcqJoin.Delete
  548.  
  549.         ' Proceed if no error
  550.         If Err.Number = 0 Then
  551.             ' Requery static cursor so deleted record is removed
  552.             If rswcqJoin.CursorType = adOpenStatic Then rswcqJoin.Requery
  553.             
  554.             ' Move off deleted rec
  555.             rswcqJoin.MoveNext
  556.             
  557.             ' If at EOF then jump back one and adjust AbsolutePage
  558.             If rswcqJoin.EOF Then
  559.                 rswcqJoin.MovePrevious
  560.                 Session("rswcqJoin_AbsolutePage") = Session("rswcqJoin_AbsolutePage") - 1                
  561.                 If rswcqJoin.BOF And rswcqJoin.EOF Then rswcqJoin.Requery
  562.             End If
  563.         End If
  564.  
  565. End Select
  566. %>
  567. <%
  568. '<!----------------------------- Error Handler --------------------------------->
  569.  
  570.    If Err Then %>
  571.     <%
  572.     ' Add additional error information to clarify specific errors
  573.     Select Case Err.Number
  574.         Case -2147467259
  575.             strErrorAdditionalInfo = "  This may be caused by an attempt to update a non-primary table in a view."
  576.         Case Else
  577.             strErrorAdditionalInfo = ""
  578.     End Select
  579.     %>
  580.     <HTML>
  581.     <HEAD>
  582.         <META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev">
  583.         <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
  584.         <META NAME="keywords" CONTENT="Microsoft Data Form, Certificate Server Queue Administration Form">
  585.         <TITLE>Certificate Server Queue Administration Form</TITLE>
  586.     </HEAD>
  587.     <BASEFONT FACE="Arial, Helvetica, sans-serif">
  588.     <LINK REL=STYLESHEET HREF="./Stylesheets/Bluemood/Style2.css">
  589.     <BODY BACKGROUND="./Images/Bluemood/Background/Back2.jpg" BGCOLOR=White>
  590.     <TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=0 BORDER=0>
  591.         <TR>
  592.             <TH COLSPAN=2 NOWRAP ALIGN=Left BGCOLOR=Silver BACKGROUND="./Images/Bluemood/Navigation/Nav1.jpg">
  593.                 <FONT SIZE=6> Message: </FONT>
  594.             </TH>
  595.         </TR>
  596.         <TR>
  597.             <TD BGCOLOR=#FFFFCC COLSPAN=2>
  598.             <FONT SIZE=3><B>
  599.             <% 
  600.             Select Case strDataAction
  601.                 Case "Insert"
  602.                     Response.Write("Unable to insert the record into Join.")
  603.                 Case "Update"
  604.                     Response.Write("Unable to post the updated record to Join.")
  605.                 Case "Delete"
  606.                     Response.Write("Unable to delete the record from Join.")
  607.             End Select
  608.             %>
  609.             </B></FONT>
  610.             </TD>
  611.         </TR>
  612.     </TABLE>
  613.     <TABLE WIDTH=100% CELLSPACING=1 CELLPADDING=2 BORDER=0>
  614.         <TR>
  615.             <TD ALIGN=Left BGCOLOR=Silver><FONT SIZE=-1><B>  Item</B></FONT></TD>
  616.             <TD WIDTH=100% ALIGN=Left BGCOLOR=Silver><FONT SIZE=-1><B>Description</B></FONT></TD>
  617.         </TR>
  618.         <TR>
  619.             <TD><FONT SIZE=-1><B>  Source:</B></FONT></TD>
  620.             <TD BGCOLOR=White><FONT SIZE=-1><%= Err.Source %></TD>
  621.         </TR>
  622.         <TR>
  623.             <TD NOWRAP><FONT SIZE=-1><B>  Error Number:</B></FONT></TD>
  624.             <TD BGCOLOR=White><FONT SIZE=-1><%= Err.Number %></FONT></TD>
  625.         </TR>
  626.         <TR>
  627.             <TD><FONT SIZE=-1><B>  Description:</B></FONT></TD>
  628.             <TD BGCOLOR=White><FONT SIZE=-1><%= Server.HTMLEncode(Err.Description & strErrorAdditionalInfo) %></FONT></TD>
  629.         </TR>
  630.         <TR>
  631.             <TD COLSPAN=2><HR></TD>
  632.         </TR>
  633.         <TR>
  634.             <TD>
  635.             <% Response.Write "<FORM ACTION=""wcqForm.asp"" METHOD=""POST"">" %>
  636.             <INPUT TYPE="Hidden" NAME="FormMode" VALUE="Edit">
  637.             <INPUT TYPE="SUBMIT" VALUE="Form View">
  638.             </FORM>
  639.             </TD>
  640.             <TD>
  641.             <FONT SIZE=-1>
  642.             To return to the form view with the previously entered 
  643.             information intact, use your browsers "back" button
  644.             </FONT>
  645.             </TD>
  646.         </TR>
  647.     </TABLE>
  648.     </BODY>
  649.     </HTML>
  650.  
  651. <% Else %>
  652. <%
  653. '<!-- Action Nofeedback -->
  654.  Response.Redirect "wcqForm.asp" 
  655. %>
  656. <% 
  657. End If 
  658. Set rswcqJoin = Nothing
  659. %>
  660.  
  661.