dcsimg
www.webdeveloper.com
Results 1 to 9 of 9

Thread: Doesn't Support Eof???????

  1. #1
    Join Date
    Feb 2003
    Location
    Sault Ste Marie, On, Canada
    Posts
    168

    Angry Doesn't Support Eof???????

    HOW THE HECK CAN'T IT SUPPORT .EOF OR THE PROPERTY???? CAN SOMEONE EXPLAIN WHAT OBJECT DOESN'T SUPPORT THE PROPERTY OR METHOD ERROR GENERALLY MEANS??????


    THIS IS WHAT I GET

    Error Type:
    Microsoft VBScript runtime (0x800A01B6)
    Object doesn't support this property or method: 'EOF'
    /hunting/wwwroot/View_Comments.asp, line 23

    AND THE WHILE LOOP WILL DYNAMICALLY UPDATE THE WEB PAGE BASED ON HOW MANY COMMENTS ARE IN THE DATABASE RIGHT?



    <% @Language = VBScript %>
    <% Option Explicit %>
    <%

    Dim dbConn, dbQuery, recordsetDB, strComments, strQueryString1


    If IsObject(Session("users_dbConn") ) Then
    Set dbConn= Session("users_dbConn")
    Else
    Set dbConn = Server.CreateObject("ADODB.Connection")

    Call dbConn.Open ("Appdb1","Anyone","Anyone")

    Set Session("users_dbConn")= dbConn
    End If
    %>

    <%
    strquerystring1 = "SELECT Comments.Comments FROM Comments "
    recordsetDB = dbconn.execute(strquerystring1)

    While Not recordsetDB.EOF

    strComments = recordsetDB("Comments").VALUE
    recordsetDB.MoveNext

    Wend

    Set recordsetDB = dbConn.Execute(strquerystring1)

    %>
    <html>

    <head>
    <title>View Comments</title>
    </head>

    <body background="grback.jpg">
    COMMENTS ABOUT THE SITE AND THE HUNTING TRIPS <BR>
    <%=strComments%>

    </body>

    </html>

  2. #2
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    try this and tell me what happens:
    <%
    Set dbConn = Server.CreateObject("ADODB.Connection")
    dbConn.Open "Appdb1"

    strquerystring1 = "SELECT Comments.Comments FROM Comments "
    set recordsetDB = dbconn.execute(strquerystring1)

    While Not recordsetDB.EOF

    strComments = recordsetDB("Comments").VALUE
    recordsetDB.MoveNext

    Wend

    %>

  3. #3
    Join Date
    Feb 2003
    Location
    Sault Ste Marie, On, Canada
    Posts
    168
    Hey I think it worked because on my web page it displays the last entry in the database on comments. But I'm still stuck with the problem of only having one entry appear not all of them. O ya I had to still make the user connection.

    Call dbConn.Open ("Appdb1","Anyone","Anyone")
    Last edited by Calmaris; 02-11-2003 at 05:37 PM.

  4. #4
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    ok thats because you are only telling it to write out the last record you need to change to something like this:
    <% @Language = VBScript %>
    <% Option Explicit %>

    <html>

    <head>
    <title>View Comments</title>
    </head>

    <body background="grback.jpg">
    <%

    Dim dbConn, dbQuery, recordsetDB, strComments, strQueryString1


    If IsObject(Session("users_dbConn") ) Then
    Set dbConn= Session("users_dbConn")
    Else
    Set dbConn = Server.CreateObject("ADODB.Connection")

    Call dbConn.Open ("Appdb1","Anyone","Anyone")

    Set Session("users_dbConn")= dbConn
    End If
    %>

    <%
    strquerystring1 = "SELECT Comments.Comments FROM Comments "
    set recordsetDB = dbconn.execute(strquerystring1)

    While Not recordsetDB.EOF %>

    <table>
    <tr>
    <td>
    <%
    strComments = recordsetDB("Comments")
    response.write ""&strComments&""
    %>
    </td>
    </tr>
    </table>

    <%
    recordsetDB.MoveNext

    Wend %>

    this line is not needed did you not notice i left it out the last time?
    ////////Set recordsetDB = dbConn.Execute(strquerystring1) //////////////////////////



    </html>
    Last edited by Ribeyed; 02-11-2003 at 05:43 PM.

  5. #5
    Join Date
    Feb 2003
    Location
    Sault Ste Marie, On, Canada
    Posts
    168
    YOU ARE THE MAN!!!!!! I CAN'T BELIEVE HOW EASY IT SEEMED. MY PROBLEM WAS THAT I WAS THINK OF COUNTERS AND MAKING IT HARDER THAN IT SEEMED. Thanks you actually put new concepts into my mind i never thought of the html in the loop. But if you could would explain what this error generally means, you changed the connection code but why?

    Error Type:
    Microsoft VBScript runtime (0x800A01B6)
    Object doesn't support this property or method:

  6. #6
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    this error
    Error Type:
    Microsoft VBScript runtime (0x800A01B6)
    Object doesn't support this property or method:
    normally means you have tried to do something with the object what the object doesn't support.

    You mentioned about changing the connection code. VBScript requires the Set function when setting objects. So you got the error beacuse you were trying to do something with an object that wasn't set.

  7. #7
    Join Date
    Feb 2003
    Location
    Sault Ste Marie, On, Canada
    Posts
    168
    BUT WHY COULDN'T IT SUPPORT .EOF AND BEFORE THAT WHEN I WAS TRYING TO USE .VALUE IT WOULDN'T SUPPORT THAT. I GOT THE .VALUE TO WORK BUT I DIDN'T CHANGE ANYTHING TO DO WITH SETTING AN OBJECT.

    LOL WAIT I'VE THOUGHT THIS OUT A BIT MORE. SO IT ACTUALLY HAS NOTHING TO DO WITH .EOF OR .VALUE. THE VARIABLE THAT SAY THE .EOF OR .VALUE IS ATTACHED EX: RS HAS TO BE SET SOMEWHERE IN THE CODE PREVIOUS TO USING IT AS RS.EOF OR RS.VALUE TELL ME IF I'M ON THE MARK.
    Last edited by Calmaris; 02-11-2003 at 06:31 PM.

  8. #8
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    yes bang on

  9. #9
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    just a note about your code. Session_OnEnd is unreliable. Do not create applications that rely on Session_OnEnd to occur, because it doesn't always happen. This is a known bug and seems to have been reduced (if not eliminated entirely) in IIS 5.0, which ships with Windows 2000. This bug is one of many reasons to not store recordsets, connections or other objects in session variables.
    You have stored connection in a session variable. This connection may or may not be closed at the end of session.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles