473,473 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

request form error

35 New Member
Hi,

I have been working on this for 2 days now, basically I need a front end to edit some data in oracle. Though everytime i pass the info between the pages i get


Expand|Select|Wrap|Line Numbers
  1. Band Name:
  2.  
  3. ADODB.Field error '80020009'
  4.  
  5. Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
  6.  
  7. /user/edit_band.asp, line 0 
this is the code behind the page

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>Update band details</title>
  4. <%
  5.  
  6. Dim strSQL, objConn, objRs
  7.  
  8. editband=request.form("editband")
  9.  
  10. strSQL = "select * from Band where band_name='"&editband&"'"
  11.  
  12. Set objConn = Server.CreateObject("ADODB.Connection")
  13. objConn.Open "dsn=Oracle;uid=user;pwd=password;"
  14. Set objRs = objConn.execute(strSQL)
  15. %>
  16. </head>
  17. <body>
  18.  <form name="booking" method="post" action="updateband.asp" onSubmit="return validate(this);">
  19.      <p>Band Name: <BR>
  20.  
  21.        <input type="text" name="band_name" maxlength="20" onChange="javascript:this.value=this.value.toLowerCase();"value="<% Response.Write objRS("band_name") %>">
  22.        <br>
  23.      Band Genre: <BR>
  24.        <select name="band_genre" size="1">
  25.             <option selected="indie"><% Response.Write objRS("genre")%></option>
  26.          <option value="Rock">Rock</option>
  27.          <option value="Metal">Metal</option>
  28.          <option value="Pop">Pop</option>
  29.          <option value="R n B">R n B</option>
  30.          <option value="jazz">Jazz</option>
  31.          <option value="Country">Country</option>
  32.          <option value="Punk">Punk</option>
  33.          <option value="Drum n Bass">Drum n Bass</option>
  34.          <option value="Dance">Dance</option>
  35.          <option value="Alternative">Alternative</option>
  36.          <option value="Other">Other</option>
  37.        </select>
  38.  
  39.      Band Location: <BR>
  40.        <input type="text" name="band_location" maxlength="50"value="<% Response.Write objRS("location") %>">
  41.  
  42.      Band Biography 
  43.      <br>
  44. <textarea name="band_bio" cols="40" rows="5"><% Response.Write objRS("band_bio") %></textarea>
  45. <BR>
  46.      <input type="submit" name="Submit" value="Submit">
  47.  
  48.      <input name="Clear" type="reset" id="Clear" value="Reset">
  49.  </form> 
  50.  <%
  51. objRs.Close
  52. Set objRs=Nothing
  53. objConn.Close
  54. Set objConn=Nothing
  55. %>
  56. </body>
  57. </html>
  58.  
with not having much experience with this im stumped. any ideas?
Feb 23 '08 #1
1 1226
jagged
23 New Member
It looks like request.form("editband") is empty, hence you are actually calling this query:

select * from band where band_name = ''


Unless you have records where band_name is an empty string, it would return an empty recordset and throw that error when you try to use it.


You should do something like:

Expand|Select|Wrap|Line Numbers
  1. editband=request.form("editband")
  2.  
  3. IF Len(editband) = 0 Then
  4. Response.Write "No band selected"
  5. Response.End
  6. End If
  7.  
If you see "No band selected" then your problem is on another page.

By the way, you need to be careful about using user input in sql queries like that. Someone can easily do an sql injection attack. At least use editband = Replace(editband, "'","''")...
Feb 24 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Christopher Brandsdal | last post by:
Hi! I get an error when I run my code Is there any other way to get te information from my form? Heres the error I get and the code beneath. Line 120 is market with ''''''''''''Line...
6
by: Andy | last post by:
hI, wOULD PLEASE HELP ME. I AM GETTIGN THE REQUEST OBJECT ERROS ASP 0105: 80004005 INDEX OUT OF RANGE ERROR. HERE IS THE SNIPPET OF CODE THAT I AM USING. WHAT IS WRONG HERE? YOU CAN SEE WHAT I AM...
4
by: spacecake | last post by:
hi, I get an error that the request object is unknown, the owc pivottable is normally clientside and request.querystring is something from the serverside, maybe that't the problem... Can anybody...
2
by: Elliot Rodriguez | last post by:
I have a form that contains a mix of dynamic controls and declared controls. All of them are intrinsic .NET controls. Several functions within the page use Request.Form to query the value of the...
4
by: whyyyy | last post by:
USING IIS 5.1, and Windows XP pro, the following form works on my system, and I can use as many form elements as I wish, as long as all form elements have the same name: "words", in this example....
5
by: Drew | last post by:
I am having an issue with an app that I built, it seems that Request.Form doesn't want to work sometimes, and only sometimes. For instance, I got a call last week about an error, I had the user...
2
by: Samuel Shulman | last post by:
I have to create a page that all it does it handle a 'POST' request with some parameters So I created a blank page and in the Load event I try to handle the parameters passed but the page...
4
by: steve_jackson | last post by:
I get this error, when I am trying to update a table in an Access DB through our intranet. Here is the section of code that is generating the error: FormItemID = Request.Form("FID") StoreNo =...
2
by: MDANH2002 | last post by:
Hi From VB.NET I want to simulate the POST request of the following HTML form <html> <title>HTTP Post Testing</title> <body> <form action=http://www.example.com/postdata ...
0
by: buntyindia | last post by:
Hi, I have a very strange problem with my application. I have developed it using Struts. I have a TextBox With Some fixed value in it and on Submit iam passing it to another page. <html:form...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.