recordset not writing to page

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default recordset not writing to page

    Hi,

    Access2000 db, w2k, iis5

    I am trying to write a couple recordsets to a page and the page doesn't
    throw an error, but it doesn't actualy write the data either -- just the
    intervening html. Can anyone spot my error -- I've been looking at it over
    an hour now, changing this and that -- and still nothing.

    ================================================== =========

    <% @Language=VBScript %>
    <% Option Explicit %>
    <%
    Dim cnnSimple ' ADO connection
    Dim rstRnd1 ' ADO recordset
    Dim rstRnd2 ' ADO recordset
    Dim rstRnd3 ' ADO recordset
    Dim strDBPath ' path to database (*.mdb) file
    %>

    <!-- #include virtual="/xxx/scripts/wwflData.asp" -->

    <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0">

    <TR>
    <TD COLSPAN="3"><IMG SRC="../../images/blank.gif" height=1 width=450></TD>
    </TR>
    <%
    Set rstRnd1 = cnnSimple.Execute("SELECT * FROM qryWWFLDraft2003 WHERE rnd=1
    ORDER BY pick")
    Do While Not rstRnd1.EOF
    %>
    <TR>
    <TD>&nbsp;</TD>
    <TD NOWRAP class="name"><%= rstRnd1.Fields("overall").Value %></TD>
    <TD><%= rstRnd1.Fields("wwflName").Value %></TD>
    </TR>
    <%
    rstRnd1.MoveNext
    Loop
    rstRnd1.Close
    Set rstRnd1 = Nothing
    %>
    <TR>
    <TD COLSPAN="3"><IMG SRC="../../images/blank.gif" height=1 width=450></TD>
    </TR>
    <TR>
    <TH COLSPAN="3">Round Two</TH >
    </TR>
    <%
    Set rstRnd2 = cnnSimple.Execute("SELECT wwflName FROM qryWWFLDraft2003
    WHERE rnd=2 ORDER BY pick")
    Do While Not rstRnd2.EOF
    %>
    <TR>
    <TD>&nbsp;</TD>
    <TD NOWRAP class="name"><%= rstRnd2.Fields("overall").Value %></TD>
    <TD><%= rstRnd2.Fields("wwflName").Value %></TD>
    </TR>
    <%
    rstRnd2.MoveNext
    Loop
    rstRnd2.Close
    Set rstRnd2 = Nothing
    %>
    <TR>
    <TD COLSPAN="3"><IMG SRC="../../images/blank.gif" height=1 width=450></TD>
    </TR>
    <TR>
    <TH COLSPAN="3">Round Three</TH >
    </TR>
    <%
    Set rstRnd3 = cnnSimple.Execute("SELECT rnd, pick, overall, wwflName FROM
    qryWWFLDraft2003 WHERE rnd=3 ORDER BY pick")
    Do While Not rstRnd3.EOF
    %>
    <TR>
    <TD>&nbsp;</TD>
    <TD NOWRAP class="name"><%= rstRnd3.Fields("overall").Value %></TD>
    <TD><%= rstRnd3.Fields("wwflName").Value %></TD>
    </TR>
    <%
    rstRnd3.MoveNext
    Loop
    rstRnd3.Close
    Set rstRnd3 = Nothing
    %>
    </TABLE>
    <%
    cnnSimple.Close
    Set cnnSimple = Nothing
    %>


    Kevin Guest

  2. Similar Questions and Discussions

    1. Recordset page navigation
      Hi , I have a page that get 1000 records and I?m displaying it 10 records a page. I want to use page numbers line 1,2,3, ...as my navigation instead...
    2. recordset paging won't show second page
      Hi I'm querying a database and returning the records using absolute page and all that stuff. The user can choose to do a keyword search or...
    3. Recordset elements failing to write to page
      I've got what I'm sure is a very simple problem. In an ASP page, I am trying to write out 4 fields from a recordset in succession: Response.Write...
    4. writing to a page after it has loaded
      I have been trying to find out how write to a page after it has loaded.. I have written an application to control pppd on our server and need to...
    5. Writing HTML Page
      Hi, just create an empty ASPX page with no codebehind file. Then place your code inside the page (inside <% ... %> of course) and use...
  3. #2

    Default Re: recordset not writing to page

    Does your query return any records? Do you have an "on error resume next"
    anywhere? What happens if you just query "select * from theTable" to verify
    that you get some records without a where clause? How about if you do:

    <td><%=rstRnd1.Fields("overall").value & " that should be the value
    there"%></td>


    Ray at home
    "Kevin" <thersitz @yahoo com> wrote in message
    news:eo9u7KtVDHA.652@tk2msftngp13.phx.gbl...
    > Hi,
    >
    > Access2000 db, w2k, iis5
    >
    > I am trying to write a couple recordsets to a page and the page doesn't
    > throw an error, but it doesn't actualy write the data either -- just the
    > intervening html. Can anyone spot my error -- I've been looking at it over
    > an hour now, changing this and that -- and still nothing.
    >
    > ================================================== =========
    >
    > <% @Language=VBScript %>
    > <% Option Explicit %>
    > <%

    Ray at Guest

  4. #3

    Default Re: recordset not writing to page

    the query works fine in access

    i don't have an error resume next

    i have pared it down to one recordset and tried and no go. the really weird
    part is I have another page with basically the same recordset and it works.

    i have css and stuff in the full page -- but i can't see that as being the
    problem.

    i can tell that it grabs the data -- because no error shows -- i can change
    a field to a non-existent field and it throws the error. I can change the
    html and it writes.

    i don't get it.

    thanks for your help Ray.

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:OICfERtVDHA.2228@TK2MSFTNGP12.phx.gbl...
    > Does your query return any records? Do you have an "on error resume next"
    > anywhere? What happens if you just query "select * from theTable" to
    verify
    > that you get some records without a where clause? How about if you do:
    >
    > <td><%=rstRnd1.Fields("overall").value & " that should be the value
    > there"%></td>
    >
    >
    > Ray at home
    > "Kevin" <thersitz @yahoo com> wrote in message
    > news:eo9u7KtVDHA.652@tk2msftngp13.phx.gbl...
    > > Hi,
    > >
    > > Access2000 db, w2k, iis5
    > >
    > > I am trying to write a couple recordsets to a page and the page doesn't
    > > throw an error, but it doesn't actualy write the data either -- just the
    > > intervening html. Can anyone spot my error -- I've been looking at it
    over
    > > an hour now, changing this and that -- and still nothing.
    > >
    > > ================================================== =========
    > >
    > > <% @Language=VBScript %>
    > > <% Option Explicit %>
    > > <%
    >
    >

    Kevin Guest

  5. #4

    Default Re: recordset not writing to page

    What about in a view-source? Do you see the values there?

    Ray at work

    "Kevin" <thersitz @yahoo com> wrote in message
    news:upncVctVDHA.3924@tk2msftngp13.phx.gbl...
    > the query works fine in access
    >
    > i don't have an error resume next
    >
    > i have pared it down to one recordset and tried and no go. the really
    weird
    > part is I have another page with basically the same recordset and it
    works.
    >
    > i have css and stuff in the full page -- but i can't see that as being the
    > problem.
    >
    > i can tell that it grabs the data -- because no error shows -- i can
    change
    > a field to a non-existent field and it throws the error. I can change the
    > html and it writes.
    >
    > i don't get it.
    >
    > thanks for your help Ray.

    Ray at Guest

  6. #5

    Default Re: recordset not writing to page

    No, it is not even writing the html for lines like this:

    <TR>
    <TD>&nbsp;</TD>
    <TD NOWRAP class="name"><%= rstRnd1.Fields("overall").Value %></TD>
    <TD><%= rstRnd1.Fields("wwflName").Value %></TD>
    </TR>

    below is the source for this call --- Set rstRnd1 =
    cnnSimple.Execute("SELECT overall, wwflName FROM qryWWFLDraft2003 WHERE
    rnd=1 ORDER BY pick") --- :

    <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0">
    <TR>
    <TH class="qb" width=1>&nbsp;</TH>
    <TH class="qb" width=10>Pick</TH>
    <TH class="qb" width=100>wwfl Team</TH>
    </TR>
    <TR>
    <TD COLSPAN="3"><IMG SRC="../../images/blank.gif" height=1 width=450></TD>
    </TR>

    <TR>
    <TD COLSPAN="3"><IMG SRC="../../images/blank.gif" height=1 width=450></TD>
    </TR>
    </TABLE>

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:O8DgugtVDHA.1984@TK2MSFTNGP11.phx.gbl...
    > What about in a view-source? Do you see the values there?
    >
    > Ray at work
    >
    > "Kevin" <thersitz @yahoo com> wrote in message
    > news:upncVctVDHA.3924@tk2msftngp13.phx.gbl...
    > > the query works fine in access
    > >
    > > i don't have an error resume next
    > >
    > > i have pared it down to one recordset and tried and no go. the really
    > weird
    > > part is I have another page with basically the same recordset and it
    > works.
    > >
    > > i have css and stuff in the full page -- but i can't see that as being
    the
    > > problem.
    > >
    > > i can tell that it grabs the data -- because no error shows -- i can
    > change
    > > a field to a non-existent field and it throws the error. I can change
    the
    > > html and it writes.
    > >
    > > i don't get it.
    > >
    > > thanks for your help Ray.
    >
    >

    Kevin Guest

  7. #6

    Default solved it Ray

    Thanks for all your help Ray. I appreciate it.

    The problem was my where statement. I had a field named "rnd" in the table,
    which was okay in the other page I have because I wasn't calling it from the
    where clause -- but in the page in which I was using a Where clause the
    field name "rnd" must be confusing it with a function or something -- is the
    random function keyword rnd?

    Any way, I changed the field name to round in the table and the query and my
    page and it works fine. What a drag all that was -- even tho I am able to
    grin now.

    thanks again.


    "Kevin" <thersitz @yahoo com> wrote in message
    news:eo9u7KtVDHA.652@tk2msftngp13.phx.gbl...
    > Hi,
    >
    > Access2000 db, w2k, iis5
    >
    > I am trying to write a couple recordsets to a page and the page doesn't
    > throw an error, but it doesn't actualy write the data either -- just the
    > intervening html. Can anyone spot my error -- I've been looking at it over
    > an hour now, changing this and that -- and still nothing.
    >
    > ================================================== =========
    >
    > <% @Language=VBScript %>
    > <% Option Explicit %>
    > <%
    > Dim cnnSimple ' ADO connection
    > Dim rstRnd1 ' ADO recordset
    > Dim rstRnd2 ' ADO recordset
    > Dim rstRnd3 ' ADO recordset
    > Dim strDBPath ' path to database (*.mdb) file
    > %>
    >
    > <!-- #include virtual="/xxx/scripts/wwflData.asp" -->
    >
    > <TABLE BORDER="0" CELLPADDING="2" CELLSPACING="0">
    >
    > <TR>
    > <TD COLSPAN="3"><IMG SRC="../../images/blank.gif" height=1
    width=450></TD>
    > </TR>
    > <%
    > Set rstRnd1 = cnnSimple.Execute("SELECT * FROM qryWWFLDraft2003 WHERE
    rnd=1
    > ORDER BY pick")
    > Do While Not rstRnd1.EOF
    > %>
    > <TR>
    > <TD>&nbsp;</TD>
    > <TD NOWRAP class="name"><%= rstRnd1.Fields("overall").Value %></TD>
    > <TD><%= rstRnd1.Fields("wwflName").Value %></TD>
    > </TR>
    > <%
    > rstRnd1.MoveNext
    > Loop
    > rstRnd1.Close
    > Set rstRnd1 = Nothing
    > %>
    > <TR>
    > <TD COLSPAN="3"><IMG SRC="../../images/blank.gif" height=1
    width=450></TD>
    > </TR>
    > <TR>
    > <TH COLSPAN="3">Round Two</TH >
    > </TR>
    > <%
    > Set rstRnd2 = cnnSimple.Execute("SELECT wwflName FROM qryWWFLDraft2003
    > WHERE rnd=2 ORDER BY pick")
    > Do While Not rstRnd2.EOF
    > %>
    > <TR>
    > <TD>&nbsp;</TD>
    > <TD NOWRAP class="name"><%= rstRnd2.Fields("overall").Value %></TD>
    > <TD><%= rstRnd2.Fields("wwflName").Value %></TD>
    > </TR>
    > <%
    > rstRnd2.MoveNext
    > Loop
    > rstRnd2.Close
    > Set rstRnd2 = Nothing
    > %>
    > <TR>
    > <TD COLSPAN="3"><IMG SRC="../../images/blank.gif" height=1
    width=450></TD>
    > </TR>
    > <TR>
    > <TH COLSPAN="3">Round Three</TH >
    > </TR>
    > <%
    > Set rstRnd3 = cnnSimple.Execute("SELECT rnd, pick, overall, wwflName FROM
    > qryWWFLDraft2003 WHERE rnd=3 ORDER BY pick")
    > Do While Not rstRnd3.EOF
    > %>
    > <TR>
    > <TD>&nbsp;</TD>
    > <TD NOWRAP class="name"><%= rstRnd3.Fields("overall").Value %></TD>
    > <TD><%= rstRnd3.Fields("wwflName").Value %></TD>
    > </TR>
    > <%
    > rstRnd3.MoveNext
    > Loop
    > rstRnd3.Close
    > Set rstRnd3 = Nothing
    > %>
    > </TABLE>
    > <%
    > cnnSimple.Close
    > Set cnnSimple = Nothing
    > %>
    >
    >

    Kevin Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139