• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

update query giving error message in asp page

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
sriramiyer
Asked:
sriramiyer
1 Solution
 
MorcalavinCommented:
Why are you creating the recordset object?(Set Rs=Server.CreateObject ("ADODB.Recordset"))

You aren't using it.  Comment it out.
0
 
XWADPACommented:
Are you sure vendordetails_new.asp is working? (I guess you are redirecting to another page)
0
 
karunamoorthyCommented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
CWS (haripriya)Commented:
Try this:

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

Otherwise, remove trim() and see.

0
 
Carl TawnSystems and Integration DeveloperCommented:
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
 
karunamoorthyCommented:
Hello SriRamIyer,

you can try this

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

From
Karunamoorthy
0
 
sriramiyerAuthor Commented:
Thank you karunamoorthy,
It works fine.
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now