Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 10th, 2004, 11:00 AM
Registered User
 
Join Date: Jan 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Not storing form details

iam using the code below but the information from the form is not saving in the database can some1 help plse. ihave used MSfrontpage but if there is an easier way of doing this then i wud like to know iam getting desperate now :(

<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
On Error Resume Next

strErrorUrl = ""

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
    Err.Clear

    Set fp_conn = Server.CreateObject("ADODB.Connection")
    FP_DumpError strErrorUrl, "Cannot create connection"

    Set fp_rs = Server.CreateObject("ADODB.Recordset")
    FP_DumpError strErrorUrl, "Cannot create record set"

    fp_conn.Open Application("database_ConnectionString")
    FP_DumpError strErrorUrl, "Cannot open database"

    fp_rs.Open "CD", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
    FP_DumpError strErrorUrl, "Cannot open record set"

    fp_rs.AddNew
    FP_DumpError strErrorUrl, "Cannot add new record set to the database"
    Dim arFormFields0(11)
    Dim arFormDBFields0(11)
    Dim arFormValues0(11)

    arFormFields0(0) = "Artist_name"
    arFormDBFields0(0) = "ArtistName"
    arFormValues0(0) = Request("Artist_name")
    arFormFields0(1) = "Album_name"
    arFormDBFields0(1) = "AlbumName"
    arFormValues0(1) = Request("Album_name")
    arFormFields0(2) = "Producer"
    arFormDBFields0(2) = "Producer"
    arFormValues0(2) = Request("Producer")
    arFormFields0(3) = "Record_label"
    arFormDBFields0(3) = "RecordLabel"
    arFormValues0(3) = Request("Record_label")
    arFormFields0(4) = "Track_1"
    arFormDBFields0(4) = "Track1"
    arFormValues0(4) = Request("Track_1")
    arFormFields0(5) = "Track_2"
    arFormDBFields0(5) = "Track2"
    arFormValues0(5) = Request("Track_2")
    arFormFields0(6) = "Track_3"
    arFormDBFields0(6) = "Track3"
    arFormValues0(6) = Request("Track_3")
    arFormFields0(7) = "Track_4"
    arFormDBFields0(7) = "Track4"
    arFormValues0(7) = Request("Track_4")
    arFormFields0(8) = "Track_5"
    arFormDBFields0(8) = "Track5"
    arFormValues0(8) = Request("Track_5")
    arFormFields0(9) = "ImagePath_1"
    arFormDBFields0(9) = "ImagePath1"
    arFormValues0(9) = Request("ImagePath_1")
    arFormFields0(10) = "ImagePath_2"
    arFormDBFields0(10) = "ImagePath2"
    arFormValues0(10) = Request("ImagePath_2")


    FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0


    fp_rs.Update
    FP_DumpError strErrorUrl, "Cannot update the database"

    fp_rs.Close
    fp_conn.Close

    FP_FormConfirmation "text/html; charset=windows-1252",_
                        "Form Confirmation",_
                        "Thank you for submitting the following information:",_
                        "Add_CD.asp",_
                        "Return to the form."

End If
End If

%>
<html>
<head>
<title>Add_CD</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>

<div id="Layer1" style="position:absolute; left:103px; top:64px; width:690px; height:484px; z-index:1">
  <form method="POST" action="AddCD.asp" webbot-action="--WEBBOT-SELF--">
    <!--webbot bot="SaveDatabase" SuggestedExt="asp" S-DataConnection="database"
    S-RecordSource="CD" U-Database-URL="online_music.mdb"
    S-Form-Fields="Artist_name Album_name Producer Record_label Track_1 Track_2 Track_3 Track_4 Track_5 ImagePath_1 ImagePath_2"
    S-Form-DBFields="ArtistName AlbumName Producer RecordLabel Track1 Track2 Track3 Track4 Track5 ImagePath1 ImagePath2" startspan U-ASP-Include-Url="_fpclass/fpdbform.inc"
    --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveDatabase" endspan i-checksum="40548"
  -->
    <label></label>
    <table width="75%" border="0">
      <tr>
        <td><strong>
          <label>Artist Name</label>
          </strong></td>
        <td><input type="text" name="Artist_name" size="20"></td>
      </tr>
      <tr>
        <td><strong>Album
          Name </strong></td>
        <td><input type="text" name="Album_name" size="20"></td>
      </tr>
      <tr>
        <td><strong>Producer
          </strong></td>
        <td><input type="text" name="Producer" size="20"></td>
      </tr>
      <tr>
        <td><strong>Record
          label </strong></td>
        <td><input type="text" name="Record_label" size="20"></td>
      </tr>
      <tr>
        <td><strong>Track
          1</strong></td>
        <td><input type="text" name="Track_1" size="20"></td>
      </tr>
      <tr>
        <td><strong>Track
          2</strong></td>
        <td><input type="text" name="Track_2" size="20"></td>
      </tr>
      <tr>
        <td><strong>Track
          3</strong></td>
        <td><input type="text" name="Track_3" size="20"></td>
      </tr>
      <tr>
        <td><strong>Track
          4</strong></td>
        <td><input name="Track_4" type="text" id="Track_4" size="20"></td>
      </tr>
      <tr>
        <td><strong>Track
          5</strong></td>
        <td><input name="Track_5" type="text" id="Track_5" size="20"></td>
      </tr>
      <tr>
        <td><strong>Front
          Image Path</strong></td>
        <td><input type="text" name="ImagePath_1" size="20"></td>
      </tr>
      <tr>
        <td height="24"><strong>Back
          Image Path</strong></td>
        <td><input name="ImagePath_2" type="text" id="ImagePath_2" size="20"></td>
      </tr>
    </table>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp; </p>
    <p>&nbsp; </p>
  </form>
</div>
<div id="Layer2" style="position:absolute; left:303px; top:382px; width:132px; height:29px; z-index:2">
  <form name="form2" method="post" action="">
    <input type="submit" name="Submit" value="Submit">
    <input type="reset" name="Reset" value="Reset">
  </form>
</div>
</body>
</html>






Similar Threads
Thread Thread Starter Forum Replies Last Post
File Details ricespn Beginning VB 6 9 April 20th, 2007 01:48 PM
Storing form array data to MySQL using PHP osemollie Beginning PHP 0 February 2nd, 2006 07:32 AM
Adding details from a form to another yami56 Access 6 September 21st, 2004 01:15 PM
Retrievin form details and sending email yus_nash Beginning PHP 3 September 16th, 2004 04:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.