Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: ADODB.Field error '80020009'


Message #1 by Leo Clayton <claytonl@z...> on Mon, 27 Nov 2000 15:28:41 -0500
--=====================_888035858==_.ALT

Content-Type: text/plain; charset="us-ascii"; format=flowed



Can someone explain this error to me:

ADODB.Field error '80020009'



Either BOF or EOF is True, or the current record has been deleted; the 

operation requested by the application requires a current

record.



?

I have a script that reads a table in a database to get an IDNumber (that I 

make a Session variable) that is used to update a table in another script.



Here is the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">



<HTML>

<HEAD>

<TITLE>EMPLOYEE MASTER DATABASE - UPDATE</TITLE>

</HEAD>



<BODY BGCOLOR="FFFF80">

<CENTER>

<H1>EMPLOYEE MASTER DATABASE UPDATE<BR>

FILE UPDATE SELECTION</H1>

</CENTER>



<CENTER>

<%

Response.Write "<B>YOU MUST <U>SELECT</U> THE FILE YOU <U>WISH TO 

UPDATE</U></B> <BR>"

%>

</CENTER>



<%



     Dim dsn

     dsn="EmployeeMaster"

     Set conn = Server.CreateObject("ADODB.Connection")

      conn.Mode=3

     conn.open dsn

     Set Session("emp_conn") = conn



     Set rs = Server.CreateObject("ADODB.RecordSet")



     sql="SELECT IDNumber FROM EmployeeTable WHERE ((FirstName = 

'"&Request.Form("Firstname")&"') AND (LastName = '" & 

Request.Form("LastName")&"'))"

     rs.Open sql, conn, 3, 3







Response.Write("The Record IDNumber is ")

Response.write(rs("IDNumber"))

Session("IDNumber") = rs("IDNumber")

%>



<FORM ACTION="UpdateEmployeeMaster.asp" METHOD="POST" >

<CENTER>



<TABLE BORDER=0>



<TR>

<TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" VALUE="Employee" 

CHECKED>EMPLOYEE PERSONAL INFO</TD>

</TR>



<TR>

<TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" 

VALUE="EmployeeSkills" >EMPLOYEE SKILLS INFO</TD>

</TR>



<TR>

<TD></TD>

<TD ALIGN=CENTER COLSPAN=2><BR>

<INPUT TYPE="Submit" VALUE="Select File To Update">  

<INPUT TYPE="RESET"></TD>

</TR>

</TABLE>



</CENTER>

</FORM>



</BODY>

</HTML>








Message #2 by RoopeshS@f... on Tue, 28 Nov 2000 10:19:00 +0530
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C058F6.8666066A

Content-Type: text/plain;

	charset="windows-1252"



Hi

This problem occurs only when there are no records in the database.just try

putting some values in database by default.I am sure that it will work

Thanks

Roopesh Sood



-----Original Message-----

From: Leo Clayton [mailto:claytonl@z...]

Sent: Tuesday, 28 November 2000 1:59 AM

To: ASP Databases

Subject: [asp_databases] ADODB.Field error '80020009'





Can someone explain this error to me:

ADODB.Field error '80020009' 



Either BOF or EOF is True, or the current record has been deleted; the

operation requested by the application requires a current

record. 



? 

I have a script that reads a table in a database to get an IDNumber (that I

make a Session variable) that is used to update a table in another script.



Here is the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">



<HTML>

<HEAD>

<TITLE>EMPLOYEE MASTER DATABASE - UPDATE</TITLE>

</HEAD>



<BODY BGCOLOR="FFFF80">

<CENTER>

<H1>EMPLOYEE MASTER DATABASE UPDATE<BR>

FILE UPDATE SELECTION</H1>

</CENTER>



<CENTER>

<%

Response.Write "<B>YOU MUST <U>SELECT</U> THE FILE YOU <U>WISH TO

UPDATE</U></B> <BR>"

%>

</CENTER>



<%



    Dim dsn

    dsn="EmployeeMaster"

    Set conn = Server.CreateObject("ADODB.Connection")

     conn.Mode=3

    conn.open dsn

    Set Session("emp_conn") = conn

    

    Set rs = Server.CreateObject("ADODB.RecordSet")

    

    sql="SELECT IDNumber FROM EmployeeTable WHERE ((FirstName 

'"&Request.Form("Firstname")&"') AND (LastName = '" &

Request.Form("LastName")&"'))"

    rs.Open sql, conn, 3, 3

    

    

    

Response.Write("The Record IDNumber is ")

Response.write(rs("IDNumber"))

Session("IDNumber") = rs("IDNumber")

%>



<FORM ACTION="UpdateEmployeeMaster.asp" METHOD="POST" >

<CENTER>



<TABLE BORDER=0>



<TR>

<TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" VALUE="Employee"

CHECKED>EMPLOYEE PERSONAL INFO</TD>

</TR>



<TR>

<TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" VALUE="EmployeeSkills"

>EMPLOYEE SKILLS INFO</TD>

</TR>



<TR>

<TD></TD>

<TD ALIGN=CENTER COLSPAN=2><BR>

<INPUT TYPE="Submit" VALUE="Select File To Update">   

<INPUT TYPE="RESET"></TD>

</TR>

</TABLE>



</CENTER>

</FORM>



</BODY>

</HTML>



---

FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

IN YOUR INBOX!

Get the latest and best HTML, XML, and JavaScript tips, tools, and 

developments from the experts. Sign up for one or more of EarthWeb's

FREE IT newsletters at http://www.earthweb.com today! 











Message #3 by "Eric Van Camp" <eric.vancamp@c...> on Tue, 28 Nov 2000 08:05:17 -0000
This is a multi-part message in MIME format.



------=_NextPart_000_0004_01C05911.F23660E0

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: 7bit



you are at the end or at the beginning of a table, be sure to have the right

fieldname..that is usually the problem...

the server returns you the message cos he did find a field with this name,

but apparantly the fields in the table are empty

    -----Original Message-----

    From: Leo Clayton [mailto:claytonl@z...]

    Sent: Monday, November 27, 2000 8:29 PM

    To: ASP Databases

    Subject: [asp_databases] ADODB.Field error '80020009'





    Can someone explain this error to me:

    ADODB.Field error '80020009'



    Either BOF or EOF is True, or the current record has been deleted; the

operation requested by the application requires a current

    record.



    ?

    I have a script that reads a table in a database to get an IDNumber

(that I make a Session variable) that is used to update a table in another

script.



    Here is the code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">



    <HTML>

    <HEAD>

    <TITLE>EMPLOYEE MASTER DATABASE - UPDATE</TITLE>

    </HEAD>



    <BODY BGCOLOR="FFFF80">

    <CENTER>

    <H1>EMPLOYEE MASTER DATABASE UPDATE<BR>

    FILE UPDATE SELECTION</H1>

    </CENTER>



    <CENTER>

    <%

    Response.Write "<B>YOU MUST <U>SELECT</U> THE FILE YOU <U>WISH TO

UPDATE</U></B> <BR>"

    %>

    </CENTER>



    <%



        Dim dsn

        dsn="EmployeeMaster"

        Set conn = Server.CreateObject("ADODB.Connection")

         conn.Mode=3

        conn.open dsn

        Set Session("emp_conn") = conn



        Set rs = Server.CreateObject("ADODB.RecordSet")



        sql="SELECT IDNumber FROM EmployeeTable WHERE ((FirstName 

'"&Request.Form("Firstname")&"') AND (LastName = '" &

Request.Form("LastName")&"'))"

        rs.Open sql, conn, 3, 3







    Response.Write("The Record IDNumber is ")

    Response.write(rs("IDNumber"))

    Session("IDNumber") = rs("IDNumber")

    %>



    <FORM ACTION="UpdateEmployeeMaster.asp" METHOD="POST" >

    <CENTER>



    <TABLE BORDER=0>



    <TR>

    <TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" VALUE="Employee"

CHECKED>EMPLOYEE PERSONAL INFO</TD>

    </TR>



    <TR>

    <TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" VALUE="EmployeeSkills"

>EMPLOYEE SKILLS INFO</TD>

    </TR>



    <TR>

    <TD></TD>

    <TD ALIGN=CENTER COLSPAN=2><BR>

    <INPUT TYPE="Submit" VALUE="Select File To Update">  

    <INPUT TYPE="RESET"></TD>

    </TR>

    </TABLE>



    </CENTER>

    </FORM>



    </BODY>

    </HTML>



    ---

    FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

    IN YOUR INBOX!

    Get the latest and best HTML, XML, and JavaScript tips, tools, and

    developments from the experts. Sign up for one or more of EarthWeb's

    FREE IT newsletters at http://www.earthweb.com today!




$subst('Email.Unsub')








Message #4 by Stephane_Dattenny@D... on Tue, 28 Nov 2000 01:54:14 -0600
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C05910.66D22210

Content-Type: text/plain;

	charset="iso-8859-1"



Your can code like that:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">



<HTML>

<HEAD>

<TITLE>EMPLOYEE MASTER DATABASE - UPDATE</TITLE>

</HEAD>



<BODY BGCOLOR="FFFF80">

<CENTER>

<H1>EMPLOYEE MASTER DATABASE UPDATE<BR>

FILE UPDATE SELECTION</H1>

</CENTER>



<CENTER>

<B> YOU MUST <U>SELECT</U> THE FILE YOU <U>WISH TO UPDATE</U></B> <BR> //

You don't have to put a response.write here !

</CENTER>



<%



    Dim dsn

    dsn="EmployeeMaster"

    Set conn = Server.CreateObject("ADODB.Connection")

    conn.Mode=3

    conn.open dsn

    ' Set Session("emp_conn") = conn : NEVER CACHE YOUR CONNECTION IN A USER

SESSION !!!

    

    Set rs = Server.CreateObject("ADODB.RecordSet")

    

    sql="SELECT IDNumber FROM EmployeeTable WHERE ((FirstName 

'"&Request.Form("Firstname")&"') AND (LastName = '" &

Request.Form("LastName")&"'))"



    ' USE DISCONNECTED RECORDSET

    set rs.ActiveConnection = conn

    rs.Open sql, , 3, 3 ' Must be equivalent to : rs.Open sql, ,

adOpenStatic, adLockBatchOptimistic, adCmdText

    set rs.ActiveConnection = nothing 

    conn.close ' You can close the connection because you have a

disconnected recordset now.

    set conn = nothing

 

    if rs.EOF then ' Test if the recordset is empty

        ' Recordset Empty: write an error msg

%>

<CENTER>

<B> IDNumber not found !!</B> <BR> // You don't have to put a response.write

here !

</CENTER>

<%

else

    ' Recordset not empty : you can retreive your ID number

 

    Response.Write("The Record IDNumber is ")

    Response.write(rs("IDNumber"))

    Session("IDNumber") = rs("IDNumber")

    rs.close ' Don't have to use the recordset anyway

    set rs = nothing



%>



<FORM ACTION="UpdateEmployeeMaster.asp" METHOD="POST" >

.......

</CENTER>

</FORM>



<%

end if

%>

</BODY>

</HTML>



Try this, it could be better.



Best regards / Cordialement<?xml:namespace prefix = o ns 

"urn:schemas-microsoft-com:office:office" />



 



Stephane Dattenny



Dell Computers - EMEA IT - VB and Web developer



Phone: +33 (0)4 99 75 49 88 



  <file://C:\WINNT\Profiles\stephane_dattenny\Application

Data\Microsoft\Signatures\./Steph_files/image002.gif> 



 



-----Original Message-----

From: Leo Clayton [mailto:claytonl@z...]

Sent: Monday, November 27, 2000 9:29 PM

To: ASP Databases

Subject: [asp_databases] ADODB.Field error '80020009'





Can someone explain this error to me:

ADODB.Field error '80020009' 



Either BOF or EOF is True, or the current record has been deleted; the

operation requested by the application requires a current

record. 



? 

I have a script that reads a table in a database to get an IDNumber (that I

make a Session variable) that is used to update a table in another script.



Here is the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">



<HTML>

<HEAD>

<TITLE>EMPLOYEE MASTER DATABASE - UPDATE</TITLE>

</HEAD>



<BODY BGCOLOR="FFFF80">

<CENTER>

<H1>EMPLOYEE MASTER DATABASE UPDATE<BR>

FILE UPDATE SELECTION</H1>

</CENTER>



<CENTER>

<%

Response.Write "<B>YOU MUST <U>SELECT</U> THE FILE YOU <U>WISH TO

UPDATE</U></B> <BR>"

%>

</CENTER>



<%



    Dim dsn

    dsn="EmployeeMaster"

    Set conn = Server.CreateObject("ADODB.Connection")

     conn.Mode=3

    conn.open dsn

    Set Session("emp_conn") = conn

    

    Set rs = Server.CreateObject("ADODB.RecordSet")

    

    sql="SELECT IDNumber FROM EmployeeTable WHERE ((FirstName 

'"&Request.Form("Firstname")&"') AND (LastName = '" &

Request.Form("LastName")&"'))"

    rs.Open sql, conn, 3, 3

    

    

    

Response.Write("The Record IDNumber is ")

Response.write(rs("IDNumber"))

Session("IDNumber") = rs("IDNumber")

%>



<FORM ACTION="UpdateEmployeeMaster.asp" METHOD="POST" >

<CENTER>



<TABLE BORDER=0>



<TR>

<TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" VALUE="Employee"

CHECKED>EMPLOYEE PERSONAL INFO</TD>

</TR>



<TR>

<TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" VALUE="EmployeeSkills"

>EMPLOYEE SKILLS INFO</TD>

</TR>



<TR>

<TD></TD>

<TD ALIGN=CENTER COLSPAN=2><BR>

<INPUT TYPE="Submit" VALUE="Select File To Update">   

<INPUT TYPE="RESET"></TD>

</TR>

</TABLE>



</CENTER>

</FORM>



</BODY>

</HTML>



---

FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

IN YOUR INBOX!

Get the latest and best HTML, XML, and JavaScript tips, tools, and 

developments from the experts. Sign up for one or more of EarthWeb's

FREE IT newsletters at http://www.earthweb.com today! 











Message #5 by Leo Clayton <claytonl@z...> on Tue, 28 Nov 2000 11:10:12 -0500
--=====================_958926853==_.ALT

Content-Type: text/plain; charset="us-ascii"; format=flowed



I understand what you are saying, but there are records in the Access 

database or at least when I look at the table I see some and am able to 

print a page that has a listing of the table and it's contents.  I have 

checked the field names and lastly, I put a MoveFirst in my code right 

after my Open and came away with the following error (a new one), at the 

line where I inserted my MoveFirst statement:

ADODB.Recordset error '800a0bcd'



Either BOF or EOF is True, or the current record has been deleted; the 

operation requested by the application requires a current

record.



/EmployeeMasterStuff/SelectFileToUpdate2.asp, line 34



Again, I can't see what I am doing wrong or why this is not working.  Can 

someone please check my code out and tell me what I am doing wrong or steer 

me in the right direction?  Here is my code, again:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">



<HTML>

<HEAD>

<TITLE>EMPLOYEE MASTER DATABASE - UPDATE</TITLE>

</HEAD>



<BODY BGCOLOR="FFFF80">

<CENTER>

<H1>EMPLOYEE MASTER DATABASE UPDATE<BR>

FILE UPDATE SELECTION</H1>

</CENTER>



<CENTER>

<%

Response.Write "<B>YOU MUST <U>SELECT</U> THE FILE YOU <U>WISH TO 

UPDATE</U></B> <BR>"

%>

</CENTER>



<%



     Dim dsn

     dsn="EmployeeMaster"

     Set conn = Server.CreateObject("ADODB.Connection")

      conn.Mode=3

     conn.open dsn

     Set Session("emp_conn") = conn



     Set rs = Server.CreateObject("ADODB.RecordSet")



     sql="SELECT IDNumber FROM EmployeeTable WHERE ((FirstName = 

'"&Request.Form("Firstname")&"') AND (LastName = '" & 

Request.Form("LastName")&"'))"

     rs.Open sql, conn, 3, 3



rs.MoveFirst





Response.Write("The Record IDNumber is ")

Response.write(rs("IDNumber"))

Session("IDNumber") = rs("IDNumber")

Response.write(Session("IDNumber"))

%>



<FORM ACTION="UpdateEmployeeMaster.asp" METHOD="POST" >

<CENTER>



<TABLE BORDER=0>



<TR>

<TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" VALUE="Employee" 

CHECKED>EMPLOYEE PERSONAL INFO</TD>

</TR>



<TR>

<TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" 

VALUE="EmployeeSkills" >EMPLOYEE SKILLS INFO</TD>

</TR>



<TR>

<TD></TD>

<TD ALIGN=CENTER COLSPAN=2><BR>

<INPUT TYPE="Submit" VALUE="Select File To Update">  

<INPUT TYPE="RESET"></TD>

</TR>

</TABLE>



</CENTER>

</FORM>



</BODY>

</HTML>







At 10:19 AM 11/28/00 +0530, you wrote:

>Hi

>This problem occurs only when there are no records in the database.just 

>try putting some values in database by default.I am sure that it will work

>Thanks

>Roopesh Sood

>>-----Original Message-----

>>From: Leo Clayton [mailto:claytonl@z...]

>>Sent: Tuesday, 28 November 2000 1:59 AM

>>To: ASP Databases

>>Subject: [asp_databases] ADODB.Field error '80020009'

>>

>>Can someone explain this error to me:

>>ADODB.Field error '80020009'

>>

>>Either BOF or EOF is True, or the current record has been deleted; the 

>>operation requested by the application requires a current

>>record.

>>

>>?

>>I have a script that reads a table in a database to get an IDNumber (that 

>>I make a Session variable) that is used to update a table in another script.

>>

>>Here is the code:

>><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

>>

>><HTML>

>><HEAD>

>><TITLE>EMPLOYEE MASTER DATABASE - UPDATE</TITLE>

>></HEAD>

>>

>><BODY BGCOLOR="FFFF80">

>><CENTER>

>><H1>EMPLOYEE MASTER DATABASE UPDATE<BR>

>>FILE UPDATE SELECTION</H1>

>></CENTER>

>>

>><CENTER>

>><%

>>Response.Write "<B>YOU MUST <U>SELECT</U> THE FILE YOU <U>WISH TO 

>>UPDATE</U></B> <BR>"

>>%>

>></CENTER>

>>

>><%

>>

>>     Dim dsn

>>     dsn="EmployeeMaster"

>>     Set conn = Server.CreateObject("ADODB.Connection")

>>      conn.Mode=3

>>     conn.open dsn

>>     Set Session("emp_conn") = conn

>>

>>     Set rs = Server.CreateObject("ADODB.RecordSet")

>>

>>     sql="SELECT IDNumber FROM EmployeeTable WHERE ((FirstName = 

>> '"&Request.Form("Firstname")&"') AND (LastName = '" & 

>> Request.Form("LastName")&"'))"

>>     rs.Open sql, conn, 3, 3

>>

>>

>>

>>Response.Write("The Record IDNumber is ")

>>Response.write(rs("IDNumber"))

>>Session("IDNumber") = rs("IDNumber")

>>%>

>>

>><FORM ACTION="UpdateEmployeeMaster.asp" METHOD="POST" >

>><CENTER>

>>

>><TABLE BORDER=0>

>>

>><TR>

>><TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" VALUE="Employee" 

>>CHECKED>EMPLOYEE PERSONAL INFO</TD>

>></TR>

>>

>><TR>

>><TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" 

>>VALUE="EmployeeSkills" >EMPLOYEE SKILLS INFO</TD>

>></TR>

>>

>><TR>

>><TD></TD>

>><TD ALIGN=CENTER COLSPAN=2><BR>

>><INPUT TYPE="Submit" VALUE="Select File To Update">  

>><INPUT TYPE="RESET"></TD>

>></TR>

>></TABLE>

>>

>></CENTER>

>></FORM>

>>

>></BODY>

>></HTML>

>>

>>---

>>FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

>>IN YOUR INBOX!

>>Get the latest and best HTML, XML, and JavaScript tips, tools, and

>>developments from the experts. Sign up for one or more of EarthWeb's

>>FREE IT newsletters at http://www.earthweb.com today!




>>

>>---

>>FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

>>IN YOUR INBOX!

>>Get the latest and best HTML, XML, and JavaScript tips, tools, and

>>developments from the experts. Sign up for one or more of EarthWeb's

>>FREE IT newsletters at http://www.earthweb.com today!









Message #6 by Leo Clayton <claytonl@z...> on Tue, 28 Nov 2000 13:45:57 -0500
--=====================_968285150==_.REL

Content-Type: multipart/alternative;

	boundary="=====================_968285160==_.ALT"



--=====================_968285160==_.ALT

Content-Type: text/plain; charset="us-ascii"; format=flowed



Stephane,



I changed my code around as you suggested and came up with the following 

new error, which I don't understand either:

ADODB.Recordset error '800a0e79'



The operation requested by the application is not allowed if the object is 

open.



/EmployeeMasterStuff/SelectFileToUpdate3.asp, line 36



This is the new code that you suggested:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">



<HTML>

<HEAD>

<TITLE>EMPLOYEE MASTER DATABASE - UPDATE</TITLE>

</HEAD>



<BODY BGCOLOR="FFFF80">

<CENTER>

<H1>EMPLOYEE MASTER DATABASE UPDATE<BR>

FILE UPDATE SELECTION</H1>

</CENTER>



<CENTER>

<B>YOU MUST <U>SELECT</U> THE FILE YOU <U>WISH TO UPDATE</U></B> <BR>



</CENTER>



<%



     Dim dsn

     dsn="EmployeeMaster"

     Set conn = Server.CreateObject("ADODB.Connection")

      conn.Mode=3

     conn.open dsn

     'Set Session("emp_conn") = conn



     Set rs = Server.CreateObject("ADODB.RecordSet")



     sql="SELECT IDNumber FROM EmployeeTable WHERE ((FirstName = 

'"&Request.Form("Firstname")&"') AND (LastName = '" & 

Request.Form("LastName")&"'))"





'USE DISCONNECTED RECORDSET

Set rs.ActiveConnection = conn

rs.Open sql,,3,3 'sql,, adOpenStatic, adLockBatchOptimistic, adCmdText

set rs.ActiveConnection = Nothing  (This is LINE 36)

conn.Close = nothing



If rs.EOF Then

         Response.Write "RECORDSET EMPTY"

%>

<CENTER>

<B>IDNumber not found!!</B><BR>

</CENTER>

<%

Else

         'Recordset not empty: you can retrieve your ID number



         Response.Write("The Record IDNumber is ")

         Response.write(rs("IDNumber"))

         Session("IDNumber") = rs("IDNumber")

         Response.write(Session("IDNumber"))

%>



<FORM ACTION="UpdateEmployeeMaster.asp" METHOD="POST" >

<CENTER>



<TABLE BORDER=0>



<TR>

<TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" VALUE="Employee" 

CHECKED>EMPLOYEE PERSONAL INFO</TD>

</TR>



<TR>

<TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" 

VALUE="EmployeeSkills" >EMPLOYEE SKILLS INFO</TD>

</TR>



<TR>

<TD></TD>

<TD ALIGN=CENTER COLSPAN=2><BR>

<INPUT TYPE="Submit" VALUE="Select File To Update">  

<INPUT TYPE="RESET"></TD>

</TR>

</TABLE>



</CENTER>

</FORM>



<%

End If

%>



</BODY>

</HTML>





At 01:54 AM 11/28/00 -0600, you wrote:

>Your can code like that:

>

><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

>

><HTML>

><HEAD>

><TITLE>EMPLOYEE MASTER DATABASE - UPDATE</TITLE>

></HEAD>

>

><BODY BGCOLOR="FFFF80">

><CENTER>

><H1>EMPLOYEE MASTER DATABASE UPDATE<BR>

>FILE UPDATE SELECTION</H1>

></CENTER>

>

><CENTER>

><B> YOU MUST <U>SELECT</U> THE FILE YOU <U>WISH TO UPDATE</U></B> <BR> // 

>You don't have to put a response.write here !

></CENTER>

>

><%

>     Dim dsn

>     dsn="EmployeeMaster"

>     Set conn = Server.CreateObject("ADODB.Connection")

>     conn.Mode=3

>     conn.open dsn

>     ' Set Session("emp_conn") = conn : NEVER CACHE YOUR CONNECTION IN A 

> USER SESSION !!!

>

>     Set rs = Server.CreateObject("ADODB.RecordSet")

>

>     sql="SELECT IDNumber FROM EmployeeTable WHERE ((FirstName = 

> '"&Request.Form("Firstname")&"') AND (LastName = '" & 

> Request.Form("LastName")&"'))"

>

>     ' USE DISCONNECTED RECORDSET

>     set rs.ActiveConnection = conn

>     rs.Open sql, , 3, 3 ' Must be equivalent to : rs.Open sql, , 

> adOpenStatic, adLockBatchOptimistic, adCmdText

>     set rs.ActiveConnection = nothing

>     conn.close ' You can close the connection because you have a 

> disconnected recordset now.

>     set conn = nothing

>

>     if rs.EOF then ' Test if the recordset is empty

>         ' Recordset Empty: write an error msg

>%>

><CENTER>

><B> IDNumber not found !!</B> <BR> // You don't have to put a 

>response.write here !

></CENTER>

><%

>else

>     ' Recordset not empty : you can retreive your ID number

>

>     Response.Write("The Record IDNumber is ")

>     Response.write(rs("IDNumber"))

>     Session("IDNumber") = rs("IDNumber")

>     rs.close ' Don't have to use the recordset anyway

>     set rs = nothing

>

>%>

>

><FORM ACTION="UpdateEmployeeMaster.asp" METHOD="POST" >

>.......

></CENTER>

></FORM>

>

><%

>end if

>%>

></BODY>

></HTML>

>

>Try this, it could be better.

>

>Best regards / Cordialement<?xml:namespace prefix = o ns = 

>"urn:schemas-microsoft-com:office:office" />

>

>

>

>Stephane Dattenny

>

>Dell Computers - EMEA IT - VB and Web developer

>

>Phone: +33 (0)4 99 75 49 88

>

>39b6a2fd.gif

>

>

>>-----Original Message-----

>>From: Leo Clayton [mailto:claytonl@z...]

>>Sent: Monday, November 27, 2000 9:29 PM

>>To: ASP Databases

>>Subject: [asp_databases] ADODB.Field error '80020009'

>>

>>Can someone explain this error to me:

>>ADODB.Field error '80020009'

>>

>>Either BOF or EOF is True, or the current record has been deleted; the 

>>operation requested by the application requires a current

>>record.

>>

>>?

>>I have a script that reads a table in a database to get an IDNumber (that 

>>I make a Session variable) that is used to update a table in another script.

>>

>>Here is the code:

>><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

>>

>><HTML>

>><HEAD>

>><TITLE>EMPLOYEE MASTER DATABASE - UPDATE</TITLE>

>></HEAD>

>>

>><BODY BGCOLOR="FFFF80">

>><CENTER>

>><H1>EMPLOYEE MASTER DATABASE UPDATE<BR>

>>FILE UPDATE SELECTION</H1>

>></CENTER>

>>

>><CENTER>

>><%

>>Response.Write "<B>YOU MUST <U>SELECT</U> THE FILE YOU <U>WISH TO 

>>UPDATE</U></B> <BR>"

>>%>

>></CENTER>

>>

>><%

>>

>>     Dim dsn

>>     dsn="EmployeeMaster"

>>     Set conn = Server.CreateObject("ADODB.Connection")

>>      conn.Mode=3

>>     conn.open dsn

>>     Set Session("emp_conn") = conn

>>

>>     Set rs = Server.CreateObject("ADODB.RecordSet")

>>

>>     sql="SELECT IDNumber FROM EmployeeTable WHERE ((FirstName = 

>> '"&Request.Form("Firstname")&"') AND (LastName = '" & 

>> Request.Form("LastName")&"'))"

>>     rs.Open sql, conn, 3, 3

>>

>>

>>

>>Response.Write("The Record IDNumber is ")

>>Response.write(rs("IDNumber"))

>>Session("IDNumber") = rs("IDNumber")

>>%>

>>

>><FORM ACTION="UpdateEmployeeMaster.asp" METHOD="POST" >

>><CENTER>

>>

>><TABLE BORDER=0>

>>

>><TR>

>><TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" VALUE="Employee" 

>>CHECKED>EMPLOYEE PERSONAL INFO</TD>

>></TR>

>>

>><TR>

>><TD><INPUT TYPE="RADIO" NAME="TableToBeUpdated" 

>>VALUE="EmployeeSkills" >EMPLOYEE SKILLS INFO</TD>

>></TR>

>>

>><TR>

>><TD></TD>

>><TD ALIGN=CENTER COLSPAN=2><BR>

>><INPUT TYPE="Submit" VALUE="Select File To Update">  

>><INPUT TYPE="RESET"></TD>

>></TR>

>></TABLE>

>>

>></CENTER>

>></FORM>

>>

>></BODY>

>></HTML>

>>

>>---

>>FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

>>IN YOUR INBOX!

>>Get the latest and best HTML, XML, and JavaScript tips, tools, and

>>developments from the experts. Sign up for one or more of EarthWeb's

>>FREE IT newsletters at http://www.earthweb.com today!




>>---

>>FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND

>>INSIGHTS IN YOUR INBOX!

>>Get the latest and best C++, Visual C++, Java, Visual Basic, and XML 

>>tips, tools, and

>>developments from the experts. Sign up for one or more of EarthWeb?s

>>FREE IT newsletters at http://www.earthweb.com today!




>>






--=====================_968285150==_.REL

Content-Type: image/gif; name="39b6a2fd.gif"

Content-ID: <4.2.2.20001128134443.00ac55d0@m...>

Content-Transfer-Encoding: base64

Content-Disposition: inline; filename="39b6a2fd.gif"





--=====================_968285150==_.REL--



Message #7 by "Ken Schaefer" <ken@a...> on Wed, 29 Nov 2000 12:01:59 +1100
Leo,



You were getting your original error because the recordset you created

contained no records.



You can't write out a recordset if there's nothing in it.



To get around this you do this test:





objRS.Open

If not objRS.EOF then

    ' there are records

Else

    ' there are no records

End if



Note that .movefirst is *not* necessary if you have just opened a recordset

since you are always at the first record if there are any.



Also, if you open a recordset with the default adOpenForwardOnly cursor

type, then .movefirst is *not* supported. It only works because ASP is

pulling records out of a cache, not from the underlying database. Eventually

your code will bomb.





I suggest going back to whatever original code you had before, and just

modifying it to put in the test above before you try to write out any

records.



The next problem is: why aren't you getting any records.

To work this out, do this:



Response.Write(sql)



which will show you what you are actually sending to the database -

sometimes the error is obvious. If not, then cut and paste the output into

the Access QBE (open the database, goto quries, select "New Query in Design

Mode" and switch to SQL view), and run the query in there, and it will tell

you where the SQL query is bombing out.



Cheers

Ken







----- Original Message -----

From: "Leo Clayton" <claytonl@z...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, November 29, 2000 5:45 AM

Subject: [asp_databases] RE: ADODB.Field error '80020009'





> Stephane,

>

> I changed my code around as you suggested and came up with the following

> new error, which I don't understand either:

> ADODB.Recordset error '800a0e79'

>

> The operation requested by the application is not allowed if the object is

> open.

>

> /EmployeeMasterStuff/SelectFileToUpdate3.asp, line 36

>



<snip>



Message #8 by "Ken Schaefer" <ken@a...> on Wed, 29 Nov 2000 12:06:20 +1100
Can you mark which is line 36?



(because the lines that are too long wrap in our email clients, and so

there's no accurate way for us to work out which one it is...and trying to

count 36 lines in an email program is pretty hard by itself)



Cheers

Ken



----- Original Message -----

From: "Leo Clayton" <claytonl@z...>

To: "ASP Databases" <asp_databases@p...>

Sent: Wednesday, November 29, 2000 5:45 AM

Subject: [asp_databases] RE: ADODB.Field error '80020009'





> Stephane,

>

> I changed my code around as you suggested and came up with the following

> new error, which I don't understand either:

> ADODB.Recordset error '800a0e79'

>

> The operation requested by the application is not allowed if the object is

> open.

>

> /EmployeeMasterStuff/SelectFileToUpdate3.asp, line 36

>



<snip>



Message #9 by "JOHN P. PARLATO" <jparlato@m...> on Tue, 28 Nov 2000 22:34:45 -0800
This is a multi-part message in MIME format.



------=_NextPart_000_0112_01C0598B.68568240

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



You are not getting a valid record set (with rows) after the record set 

open.

You must check for eof bof prior to processing the record set.

You should check your sql out in the access query analyzer to insure it 

is returning data.

If you response.write it out, then copy and paste it to the access query 

analyzer to insure you are testing what your executing in asp.





  ----- Original Message -----

  From: Leo Clayton

  To: ASP Databases

  Sent: Tuesday, November 28, 2000 8:10 AM

  Subject: [asp_databases] RE: ADODB.Field error '80020009'





  I understand what you are saying, but there are records in the Access 

database or at least when I look at the table I see some and am able to 

print a page that has a listing of the table and it's contents.  I have 

checked the field names and lastly, I put a MoveFirst in my code right 

after my Open and came away with the following error (a new one), at the 

line where I inserted my MoveFirst statement:

  ADODB.Recordset error '800a0bcd'



  Either BOF or EOF is True, or the current record has been deleted; the 

operation requested by the application requires a current

  record.



  /EmployeeMasterStuff/SelectFileToUpdate2.asp, line 34



  Again, I can't see what I am doing wrong or why this is not working.  

Can someone please check my code out and tell me what I am doing wrong 

or steer me in the right direction?  Here is my code, again:

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">



  <HTML>

  <HEAD>

  <TITLE>EMPLOYEE MASTER DATABASE - UPDATE</TITLE>

  </HEAD>



  <BODY BGCOLOR=3D"FFFF80">

  <CENTER>

  <H1>EMPLOYEE MASTER DATABASE UPDATE<BR>

  FILE UPDATE SELECTION</H1>

  </CENTER>



  <CENTER>

  <%

  Response.Write "<B>YOU MUST <U>SELECT</U> THE FILE YOU <U>WISH TO 

UPDATE</U></B> <BR>"

  %>

  </CENTER>



  <%



      Dim dsn

      dsn=3D"EmployeeMaster"

      Set conn =3D Server.CreateObject("ADODB.Connection")

       conn.Mode=3D3

      conn.open dsn

      Set Session("emp_conn") =3D conn

     

      Set rs =3D Server.CreateObject("ADODB.RecordSet")

     

      sql=3D"SELECT IDNumber FROM EmployeeTable WHERE ((FirstName =3D 

'"&Request.Form("Firstname")&"') AND (LastName =3D '" & 

Request.Form("LastName")&"'))"

      rs.Open sql, conn, 3, 3



  rs.MoveFirst   

     

     

  Response.Write("The Record IDNumber is ")

  Response.write(rs("IDNumber"))

  Session("IDNumber") =3D rs("IDNumber")

  Response.write(Session("IDNumber"))

  %>



  <FORM ACTION=3D"UpdateEmployeeMaster.asp" METHOD=3D"POST" >

  <CENTER>



  <TABLE BORDER=3D0>



  <TR>

  <TD><INPUT TYPE=3D"RADIO" NAME=3D"TableToBeUpdated" VALUE=3D"Employee" 

CHECKED>EMPLOYEE PERSONAL INFO</TD>

  </TR>



  <TR>

  <TD><INPUT TYPE=3D"RADIO" NAME=3D"TableToBeUpdated" 

VALUE=3D"EmployeeSkills" >EMPLOYEE SKILLS INFO</TD>

  </TR>



  <TR>

  <TD></TD>

  <TD ALIGN=3DCENTER COLSPAN=3D2><BR>

  <INPUT TYPE=3D"Submit" VALUE=3D"Select File To Update">  

  <INPUT TYPE=3D"RESET"></TD>

  </TR>

  </TABLE>



  </CENTER>

  </FORM>



  </BODY>

  </HTML>







  At 10:19 AM 11/28/00 +0530, you wrote:



    Hi

    This problem occurs only when there are no records in the 

database.just try putting some values in database by default.I am sure 

that it will work

    Thanks

    Roopesh Sood

        -----Original Message-----

        From: Leo Clayton [mailto:claytonl@z...]

        Sent: Tuesday, 28 November 2000 1:59 AM

        To: ASP Databases

        Subject: [asp_databases] ADODB.Field error '80020009'





        Can someone explain this error to me:

        ADODB.Field error '80020009'





        Either BOF or EOF is True, or the current record has been 

deleted; the operation requested by the application requires a current

        record.





        ?

        I have a script that reads a table in a database to get an 

IDNumber (that I make a Session variable) that is used to update a table 

in another script.





        Here is the code:

        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">





        <HTML>

        <HEAD>

        <TITLE>EMPLOYEE MASTER DATABASE - UPDATE</TITLE>

        </HEAD>





        <BODY BGCOLOR=3D"FFFF80">

        <CENTER>

        <H1>EMPLOYEE MASTER DATABASE UPDATE<BR>

        FILE UPDATE SELECTION</H1>

        </CENTER>





        <CENTER>

        <%

        Response.Write "<B>YOU MUST <U>SELECT</U> THE FILE YOU <U>WISH 

TO UPDATE</U></B> <BR>"

        %>

        </CENTER>





        <%





            Dim dsn

            dsn=3D"EmployeeMaster"

            Set conn =3D Server.CreateObject("ADODB.Connection")

             conn.Mode=3D3

            conn.open dsn

            Set Session("emp_conn") =3D conn

           

            Set rs =3D Server.CreateObject("ADODB.RecordSet")

           

            sql=3D"SELECT IDNumber FROM EmployeeTable WHERE ((FirstName 

=3D '"&Request.Form("Firstname")&"') AND (LastName =3D '" & 

Request.Form("LastName")&"'))"

            rs.Open sql, conn, 3, 3

           

           

           

        Response.Write("The Record IDNumber is ")

        Response.write(rs("IDNumber"))

        Session("IDNumber") =3D rs("IDNumber")

        %>





        <FORM ACTION=3D"UpdateEmployeeMaster.asp" METHOD=3D"POST" >

        <CENTER>





        <TABLE BORDER=3D0>





        <TR>

        <TD><INPUT TYPE=3D"RADIO" NAME=3D"TableToBeUpdated" 

VALUE=3D"Employee" CHECKED>EMPLOYEE PERSONAL INFO</TD>

        </TR>





        <TR>

        <TD><INPUT TYPE=3D"RADIO" NAME=3D"TableToBeUpdated" 

VALUE=3D"EmployeeSkills" >EMPLOYEE SKILLS INFO</TD>

        </TR>





        <TR>

        <TD></TD>

        <TD ALIGN=3DCENTER COLSPAN=3D2><BR>

        <INPUT TYPE=3D"Submit" VALUE=3D"Select File To 

Update">  

        <INPUT TYPE=3D"RESET"></TD>

        </TR>

        </TABLE>





        </CENTER>

        </FORM>





        </BODY>

        </HTML>





        ---

        FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

        IN YOUR INBOX!

        Get the latest and best HTML, XML, and JavaScript tips, tools, 

and

        developments from the experts. Sign up for one or more of 

EarthWeb's

        FREE IT newsletters at http://www.earthweb.com today!



roopeshs@f...


$subst('Email.Unsub')





      ---

      FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS

      IN YOUR INBOX!

      Get the latest and best HTML, XML, and JavaScript tips, tools, and 



      developments from the experts. Sign up for one or more of 

EarthWeb's

      FREE IT newsletters at http://www.earthweb.com today!



Leo.Clayton@z...


$subst('Email.Unsub')

    ---

    FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND

    INSIGHTS IN YOUR INBOX!

    Get the latest and best C++, Visual C++, Java, Visual Basic, and XML 

tips, tools, and

    developments from the experts. Sign up for one or more of EarthWeb?s

    FREE IT newsletters at http://www.earthweb.com today!



jparlato@m...


$subst('Email.Unsub')









  Return to Index