home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 July & August / Pcwk78a98.iso / Micrsoft / VJ / COMMON / WIZARD98 / VIWZ1.DLL / 1033 / HTMX / 1539 < prev    next >
Text File  |  1998-02-24  |  4KB  |  140 lines

  1. <%Response.Buffer=True%>
  2.  
  3. <SCRIPT RUNAT=Server LANGUAGE="VBScript">
  4. '-------------------------------------------------------------------------------
  5. ' <%#Purpose#%>
  6. ' <%#Assumes#%>
  7. ' <%#Inputs#%>
  8. '-------------------------------------------------------------------------------
  9.  
  10. Sub InsertField(strDBFieldName, strFormFieldName)
  11.     If Trim(Request(strFormFieldName)) <> "" Then
  12.         rsFeedback(strDBFieldName) = Trim(Request(strFormFieldName))
  13.     End If
  14. End Sub
  15. </Script>
  16.  
  17. <!--<%#CommConnServ#%>-->
  18. <!--<%#CommBeginVIDGen#%>--> 
  19.  
  20. <!--METADATA TYPE="DesignerControl" startspan
  21.     <OBJECT ID="rsFeedback" WIDTH=151 HEIGHT=24
  22.      CLASSID="CLSID:7FAEED80-9D58-11CF-8F68-00AA006D27C2">
  23.         <PARAM NAME="_Version" VALUE="65536">
  24.         <PARAM NAME="_Version" VALUE="65536">
  25.         <PARAM NAME="_ExtentX" VALUE="3969">
  26.         <PARAM NAME="_ExtentY" VALUE="635">
  27.         <PARAM NAME="_StockProps" VALUE="0">
  28.         <PARAM NAME="DataConnection" VALUE="Northwind">
  29.         <PARAM NAME="CommandText" VALUE="SELECT Name, Email, Tel, Fax, CommentType, CommentArea, Comments, CommentDate FROM <%#FeedbackTable#%>">
  30.     </OBJECT>
  31. -->
  32. <%
  33. Set <%#DBConn#%> = Server.CreateObject("ADODB.Connection")
  34. <%#DBConn#%>.ConnectionTimeout = Session("<%#DBConn#%>_ConnectionTimeout")
  35. <%#DBConn#%>.CommandTimeout = Session("<%#DBConn#%>_CommandTimeout")
  36. <%#DBConn#%>.Open Session("<%#DBConn#%>_ConnectionString"), Session("<%#DBConn#%>_RuntimeUserName"), Session("<%#DBConn#%>_RuntimePassword")
  37. Set cmdTemp = Server.CreateObject("ADODB.Command")
  38. Set rsFeedback = Server.CreateObject("ADODB.Recordset")
  39. cmdTemp.CommandText = "SELECT Name, Email, Tel, Fax, CommentType, CommentArea, Comments, CommentDate FROM <%#FeedbackTable#%>"
  40. cmdTemp.CommandType = 1
  41. Set cmdTemp.ActiveConnection = <%#DBConn#%>
  42. rsFeedback.Open cmdTemp, , 1, 3
  43. %>
  44. <!--METADATA TYPE="DesignerControl" endspan-->
  45.  
  46. <%
  47. On Error Resume Next
  48. rsFeedback.AddNew
  49. InsertField "Name","UserName"
  50. InsertField "Email","UserEmail"
  51. InsertField "Tel","UserTel"
  52. InsertField "Fax","UserFax"
  53. InsertField "CommentType","MessageType"
  54. If Trim(Request("Subject")) = "(Other)" Then
  55.     InsertField "CommentArea","SubjectOther"
  56. Else
  57.     InsertField "CommentArea","Subject"
  58. End If
  59. InsertField "Comments","Comments"
  60. rsFeedback("CommentDate") = Now()
  61. rsFeedback.Update
  62. %>
  63.  
  64. <!--<%#EndVIDGen#%>--> 
  65.  
  66. <% If Err Then %>
  67.     <HTML>
  68.     <HEAD>
  69.         <META NAME="GENERATOR" CONTENT="Microsoft Visual InterDev">
  70.         <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
  71.         <META NAME="keywords" CONTENT="Microsoft Department Site Wizard, Feedback Form">
  72.         <TITLE><%#FbFrm#%></TITLE>
  73.     </HEAD>
  74.     <BASEFONT FACE="Arial, Helvetica, sans-serif">
  75.     <LINK REL=STYLESHEET HREF="./Stylesheets/<%#THEMENAME#%>/Style2.css">
  76.  
  77.     <body background="./images/<%#THEMENAME#%>/Background/back2.jpg" 
  78.     alink="#FF000" bgcolor="#FFFFFF" topmargin=20 leftmargin=10>
  79.  
  80.     <TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=0 BORDER=0>
  81.         <TR>
  82.             <TH COLSPAN=2 NOWRAP ALIGN=Left BGCOLOR=Silver BACKGROUND="./Images/<%#THEMENAME#%>/Navigation/Nav1.jpg">
  83.                 <FONT SIZE=6> Message: </FONT>
  84.             </TH>
  85.         </TR>
  86.         <TR>
  87.             <TD BGCOLOR=#FFFFCC COLSPAN=2>
  88.             <FONT SIZE=3><B>
  89.             <%Response.Write ("<%#UnableToAdd#%>")%>
  90.             </B></FONT>
  91.             </TD>
  92.         </TR>
  93.     </TABLE>
  94.     <TABLE WIDTH=100% CELLSPACING=1 CELLPADDING=2 BORDER=0>
  95.         <TR>
  96.             <TD ALIGN=Left BGCOLOR=Silver><FONT SIZE=-1><B>  Item</B></FONT></TD>
  97.             <TD WIDTH=100% ALIGN=Left BGCOLOR=Silver><FONT SIZE=-1><B><%#Desc#%></B></FONT></TD>
  98.         </TR>
  99.         <TR>
  100.             <TD><FONT SIZE=-1><B>  <%#Src#%>:</B></FONT></TD>
  101.             <TD BGCOLOR=White><FONT SIZE=-1><%= Err.Source %></TD>
  102.         </TR>
  103.         <TR>
  104.             <TD NOWRAP><FONT SIZE=-1><B>  <%#ErrNum#%>:</B></FONT></TD>
  105.             <TD BGCOLOR=White><FONT SIZE=-1><%= Err.Number %></FONT></TD>
  106.         </TR>
  107.         <TR>
  108.             <TD><FONT SIZE=-1><B>  <%#Desc#%>:</B></FONT></TD>
  109.             <TD BGCOLOR=White><FONT SIZE=-1><%= Err.Description %></FONT></TD>
  110.         </TR>
  111.         <TR>
  112.             <TD COLSPAN=2><HR></TD>
  113.         </TR>
  114.         <TR>
  115.             <TD>
  116.             <FORM ACTION="Feedback.htm">
  117.             <INPUT TYPE="SUBMIT" VALUE="<%#BackToFbFrm#%>">
  118.             </FORM>
  119.             </TD>
  120.             <TD>
  121.             <FONT SIZE=-1>
  122.             <%#RetToPrev#%>
  123.             </FONT>
  124.             </TD>
  125.         </TR>
  126.     </TABLE>
  127.     </BODY>
  128.     </HTML>
  129.  
  130. <% Else %>
  131.  
  132.     <%Response.Redirect "Response.htm"%>
  133.  
  134. <% End If %>
  135.  
  136.  
  137. </body>
  138. </html>
  139.