Solved

update query giving error message in asp page

Posted on 2006-06-27
7
250 Views
Last Modified: 2008-03-17
This is my code in asp page.....

<html>
<head>
<title>New Vendor Registration</title>
</head>
<body>

<%

myuserid=trim(Session("User_id"))
myemailid=Request.form("txtemailid")
' response.write(myemailid)
' response.write(myuserid)

if request.form("Submit")<>"" then
   Set con=Server.CreateObject("ADODB.connection")
   Set Rs=Server.CreateObject ("ADODB.Recordset")
   Con.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("../../readwritedata/tenders.mdb")

   insString="UPDATE userid SET emailid='" & myemailid & "'" & " where user_id='"& myuserid & "'"
   response.write(inSstring)
   'response.end

   Con.execute(insString)

   Session("User_id")=Request.form("userid")
   response.redirect("vendordetails_new.asp")
end if

%>

</body>
</html>

'**********************************

My error message in IE web browser is

Error Type:
ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/nic/MATLS-MGMT/matls-mgmt-vendors/vendordetails_new.asp


how to resolve this.
however My access table is updated correctly.


0
Comment
Question by:sriramiyer
7 Comments
 
LVL 18

Expert Comment

by:Morcalavin
ID: 16991942
Why are you creating the recordset object?(Set Rs=Server.CreateObject ("ADODB.Recordset"))

You aren't using it.  Comment it out.
0
 
LVL 1

Expert Comment

by:XWADPA
ID: 16991964
Are you sure vendordetails_new.asp is working? (I guess you are redirecting to another page)
0
 
LVL 7

Expert Comment

by:karunamoorthy
ID: 16992056
The most common error you mentioned above is due to ....

Either BOF or EOF is True, or the current record has been deleted
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.
This is a recordset error. It means that you have tried to read into a variable or display in a web page a record from the recordset that has either been deleted or does not exist.

The most common occurance of this error is if you have run a database query that has not returned any records and you have then tried to read in a record from the recordset that contains no data.

You need to first check that there is a record in the recordset before reading it in (eg. 'If NOT rsRecordSet.EOF Then').

from
Karunamoorthy
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 16

Expert Comment

by:CWS (haripriya)
ID: 16992064
Try this:

insString="UPDATE userid SET emailid='" & myemailid & "'  where user_id='" & myuserid & "'"

Otherwise, remove trim() and see.

0
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 16992443
As XWADPA mentioned, you need to be looking at the page you are redirecting to. There is nothing in the code you posted that can throw the error you have mentioned.
0
 
LVL 7

Accepted Solution

by:
karunamoorthy earned 500 total points
ID: 16998444
Hello SriRamIyer,

you can try this

comment the line
'Session("User_id")=Request.form("userid")

From
Karunamoorthy
0
 
LVL 5

Author Comment

by:sriramiyer
ID: 16998447
Thank you karunamoorthy,
It works fine.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Asp in server side with Mssql Server 7 4 34
CREATE DATABASE 3 36
Extracting nodes  using classical ASP 3 29
JS to redirect to prev page 8 25
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question