Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 28th, 2004, 10:35 AM
abhan abhan is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 7 abhan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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" >&nbsp;<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>&nbsp;&nbsp;&nbsp;&nbsp; <INPUT type=Submit size=28 value=UPDATE name=update></P>
<P>&nbsp; </P>
</FORM>

</body>
</html>

Kindly Help!!!
----------------------
Regards,
Aparna

Reply With Quote
  #2  
Old November 29th, 2004, 11:18 AM
selwonk's Avatar
selwonk selwonk is offline
Contributing User
ASP Free Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2004
Posts: 2,942 selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level)selwonk User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 6 Days 9 h 49 m 28 sec
Reputation Power: 62
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!

Reply With Quote
  #3  
Old November 30th, 2004, 06:37 AM
kakarottt kakarottt is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 63 kakarottt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 9 sec
Reputation Power: 4
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..

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > ASP Error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway