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> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </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>
|