fejl i update af db
Hej !Jeg får denne fejl :
Fejltype:
ADODB.Recordset (0x800A0BCD)
Enten er BOF eller EOF sand, eller den aktuelle post er blevet slettet. Den anmodede handling kræver en aktuel post.
/test/fangstbasen/fangstrapporter/html/update_entry.asp, line 33
Ved forsøg på at update min database med nedenstående fil, Jeg har stirret mig blind på det efterhånden...Hvis I skal se siden der kalder nedenstående så skriv lige, den fylder bare meget!
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsUpdateEntry 'Holds the recordset for the record to be updated
Dim strSQL 'Holds the SQL query for the database
Dim lngRecordNo 'Holds the record number to be updated
'Read in the record number to be updated
lngRecordNo = CLng(Request.Form("ID_no"))
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../db/krcDB.mdb")
'Create an ADO recordset object
Set rsUpdateEntry = Server.CreateObject("ADODB.Recordset")
'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT testtabel.* FROM testtabel WHERE ID_no=" & lngRecordNo
'Set the cursor type we are using so we can navigate through the recordset
rsUpdateEntry.CursorType = 2
'Set the lock type so that the record is locked by ADO when it is updated
rsUpdateEntry.LockType = 3
'Open the tblComments table using the SQL query held in the strSQL varaiable
rsUpdateEntry.Open strSQL, adoCon
'Update the record in the recordset
rsUpdateEntry.Fields("Forfatter") = Request.Form("Forfatter")
rsUpdateEntry.Fields("fangstmnd") = Request.Form("fangstmnd")
rsUpdateEntry.Fields("fangst") = Request.Form("fangst")
rsUpdateEntry.Fields("vaegt") = Request.Form("vaegt")
rsUpdateEntry.Fields("sted") = Request.Form("sted")
rsUpdateEntry.Fields("metode") = Request.Form("metode")
rsUpdateEntry.Fields("beretning") = Replace(Replace(Request.Form("indhold"),"""","'"),"'","''")
'Write the updated recordset to the database
rsUpdateEntry.Update
'Reset server objects
rsUpdateEntry.Close
Set rsUpdateEntry = Nothing
Set adoCon = Nothing
'Return to the update select page incase another record needs deleting
Response.Redirect "update_select.asp"
%>
