Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODB.field error.............HELP

Status
Not open for further replies.

OSU

Programmer
Sep 25, 2001
10
NO
I wonder if anybody can help me with the problem showed below.
When I click on a "link" so I can Edit I get this message
The Code wil be below..

line 21 "editdata.asp" --> form_ArtNr=rstemp("ArtNr")

*********************************************************
ADODB.Field error '800a0bcd'

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

/Project1_Local/ddag/editdata.asp, line 21
********************************************************
------------------visdata.asp---------------------- <%@Language=VBScript %>
<%
Response.buffer=true
Response.ExpiresAbsolute=Now() - 1
Response.Addheader &quot;Cache-Control&quot;, &quot;private&quot;
%>
<HTML>
<HEAD>
<META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>
</HEAD>
<BODY>



<%
myname=Request.Form(&quot;KundeNr&quot;)

dbname=&quot;/Project1_Local/MPS2000/mps2000-Da.mdb&quot;
myconnect=&quot;PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=&quot;
myconnect=myconnect & server.MapPath(dbname) & &quot;;&quot;
sqltemp=&quot;SELECT ArtNr AS ArtNr , OrdreNr AS Orders, Bygg AS Ref , ArtTekst AS ArtText , Ant AS Qty, Levert AS DQty ,Leveringstid AS DeliveryDate , Kommentar AS Comment FROM Purring where KundeNr='&quot;
sqltemp=sqltemp & myname & &quot;'&quot;

IDfield=&quot;ArtNr&quot;
scriptresponder=&quot;editdata.asp&quot;

set conntemp=server.CreateObject(&quot;adodb.connection&quot;)
conntemp.Open myconnect
set rstemp=conntemp.Execute(sqltemp)
howmanyfields=rstemp.fields.count -1
%>
<P align=center><table border=&quot;1&quot; style=&quot;FONT: 12px Width =100%&quot; borderColor=white bgColor=silver align=center>

<TR>
<td valign=&quot;top&quot;>---</td>
<%'Heading
for i=0 to howmanyfields%>
<td><b><%=rstemp(i).name %></b></td>

<%next%>

</TR>
<%
do while not rstemp.eof %>
<tr><td valign=&quot;top&quot;>
<%my_link=scriptresponder & &quot;?ArtNr=&quot; & rstemp(IDfield)%>
<a href=&quot;<%=my_link%>&quot;>Edit</a></td>
<%for i =0 to howmanyfields%>
<td valign=&quot;top&quot;><%=rstemp(i)%></td>
<%next%>
</tr>
<%
rstemp.movenext
loop

rstemp.close
set rstemp=nothing
conntemp.Close
set conntemp=nothing
%>
</table></P></STRONG>


</BODY>
</HTML>
*************editdata.asp**************
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>
</HEAD>

<%
dbname=&quot;/Project1_Local/MPS2000/mps2000-Da.mdb&quot;
myconnect=&quot;PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=&quot;
myconnect=myconnect & server.MapPath(dbname) & &quot;;&quot;
set conntemp=server.CreateObject(&quot;adodb.connection&quot;)
conntemp.Open myconnect
form_ID=Request.QueryString(&quot;ArtNr&quot;)

sqltemp=&quot;SELECT * from Purring &quot;
sqltemp=sqltemp & &quot;where ArtNr=&quot; & form_ID


set rstemp=conntemp.Execute(sqltemp)

form_ArtNr=rstemp(&quot;ArtNr&quot;)
form_Leveringstid=rstemp(&quot;Leveringstid&quot;)
form_Kommentar=rstemp(&quot;Kommentar&quot;)

rstemp.close
set rstemp=nothing
conntemp.close
set conntemp=nothing
%>

<BODY>
<form name=&quot;edit&quot; action=&quot;oppdaterdata.asp&quot; method=&quot;POST&quot;>
<Input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;<%=form_ArtNr%>&quot;>
<p>ArtNr: <%form_ArtNr%></p>
<p>Delivery Date:
<input type=&quot;Text&quot; name=&quot;Leveringstid&quot; value=&quot;<%form_Leveringstid%>&quot;></p>
<p>Comment:
<input type=&quot;Text&quot; name=&quot;kommentar&quot; value=&quot;<%form_Kommentar%>&quot;></p>
<p> <input type=&quot;Submit&quot;> </p>
</form>
</BODY>
</HTML>

 
basically this error means that the recordset returned from the database is empty. either your select is wrong or the table is empty.
my guess is that the problem is on line 30:
howmanyfields=rstemp.fields.count -1

try using a condition to check if the recordset is empty before using it. something like this:
Code:
If Not rstemp.EOF Then
    howmanyfields=rstemp.fields.count -1
Else
    howmanyfields=0
End If
(-:
 
Thank you for your answer..
I will try what you wrote..
My tables are not empty....
 
I had this same problem last week. I was using more that one recordset and had a typo such as rst.movenext and it was suppose to be rst3.movenext. See if you have a typo in your recordset code.
 
Thanks for your tips...but I still get the same error message......
PS. There are 2 fields in the table which are empty...
 
Check the URL link in visdata.asp and make sure you are passing the correct information in the querystring.

Try running the select statment directly in MSAccess to see if you get any data returned.

sqltemp=&quot;SELECT * from Purring &quot;
sqltemp=sqltemp & &quot;where ArtNr=&quot; & form_ID


I would expect you are getting an empty resultset.

Hope this helps.

Gabe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top