Solved

update query giving error message in asp page

Posted on 2006-06-27
7
251 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

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…
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…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

726 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