Solved

update query giving error message in asp page

Posted on 2006-06-27
7
246 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now