Groups | Blog | Home
all groups > inetserver asp db > july 2003 >

inetserver asp db : recordset not writing to page



Kevin
7/30/2003 12:42:35 PM
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
7/30/2003 1:13:44 PM
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.

[quoted text, click to view]

Kevin
7/30/2003 1:34:27 PM
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>

[quoted text, click to view]

Kevin
7/30/2003 1:47:01 PM
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.


[quoted text, click to view]

Ray at <%=sLocation%
7/30/2003 3:53:35 PM
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
[quoted text, click to view]

Ray at <%=sLocation%
7/30/2003 4:21:36 PM
What about in a view-source? Do you see the values there?

Ray at work

[quoted text, click to view]

AddThis Social Bookmark Button