|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP Error
Hi,
I am a beginner in ASP,and am getting an error in one of my projects.The problem lies in an update query.I have written two asp programs. searchupdate.asp and resultupdate.asp.The first one just has a text box in which i enter a form id.It is as per this form id that my database should get updated,which i am trying to do in the second proggram of name resultupdate.asp... The problem is that when i click on update,it gives me an error mentioning that form_id is not present.Actually it is unable to retrieve the form id ,and hence it is giving the error.I am unable to proceed with this.I have wasted 4 days on this.Kindly help. Please find the code underneath. ---------------------------- searchupdate.asp <HTML> <HEAD> </HEAD> <BODY> <FORM METHOD="post" ACTION="ResultUpdate.asp" id=form1 name=form1> <P><input name="Form Id" > <INPUT type="submit" value="Submit" name="bt_submit"></P> </FORM> </BODY> </HTML> ------------- resultupdate.asp <html> <body> <form action="resultupdate.asp" method="post" name="frmconfrm> <% Dim con,rs,sql,i,sql1,objrs,rs1,sql2,txt1 con=null rs=null objrs=null sql=null sql1=null sql2=null Set rs=server.createObject("adodb.Recordset") set con=server.CreateObject("adodb.Connection") con.open "dsn=Banquet;uid=;pwd=; " If Request.form("update")="" Then id=Request.form("Form Id") sql="select Form_id,Function_date,Snacks,Item from Banquet where Form_id="&id&" " rs.open sql,con else id=Request.form("Form Id") fn=Request.form("txt_dt") snks=Request.form("txt_snks") items=Request.form("txt_item") sql="update Banquet Set Function_date=#"&fn&"#,Snacks='"&snks&"',Item='"&items&"' where Form_id="&id&" " con.execute sql con.close set con=nothing end if %> <table> <tr> <td>Form id </td> <td><input type="text" name="txt_id" value="<%=rs("Form_id") %>"></td> </tr> <tr> <td>Function Date </td> <td><input type="text" name="txt_dt" value="<%=rs("Function_date") %>"></td> </tr> <tr> <td>Snacks</td> <td><input type="text" name="txt_snks" value="<%=rs("Snacks") %>"></td> </tr> <tr> <td>Item</td> <td><input type="text" name="txt_item" value="<%=rs("Item") %>"></td> </tr> </table> <P> <INPUT type=Submit size=28 value=UPDATE name=update></P> <P> </P> </FORM> </body> </html> Kindly Help!!! ---------------------- Regards, Aparna |
|
#2
|
||||
|
||||
|
Why don't you post this in the ASP forum?
__________________
selwonk If I've posted some code above, you might think it looks a bit simplistic. It might be. I'd rather people tried the next step themselves rather than getting a full solution on a plate. That way they learn more! |
|
#3
|
|||
|
|||
|
wherever you have "Form id", change it to "FormID" without the space.. that may be causing you troubles.. if you were using a request.querystring, i am almost positive that it would give you trouble.. just a thought..
|
![]() |
| Viewing: ASP Free Forums > Other > Programming Help > ASP Error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|