troubleshooting Question

SQL Server/Classic ASP Execute Returning No Records

Avatar of Bob Schneider
Bob SchneiderFlag for United States of America asked on
ASPSQL
3 Comments2 Solutions44 ViewsLast Modified:
I am trying to create an array if any records are returned in a query.  Here is my query (note that I want to use execute rather than CreateObject/Open because it is quicker and we have some events that get a lot of traffic on race day).

Here is my query:
Dim Meets

sql = "SELECT MeetsID, MeetName FROM Meets WHERE MeetDate = '10/25/2019' ORDER BY MeetName"
Set rs = conn2.Execute(sql)
If Not rs.BOF = rs.EOF Then Meets = rs.GetRows()
Set rs = Nothing

Here is where I look for the results of the query:
                                    <%If IsArray(Meets) > 0 Then%>
                                        <%If sTeamInd = "ind" Then%>
                                            <div style="text-aligh:right;">
                                                <a href="results.asp?meet_id=<%=lMeetID%>&amp;race_id=<%=lRaceID%>&amp;team_ind=team">View Team Results</a>
                                            </div>
                                        <%Else%>
                                            <div style="text-aligh:right;">
                                                <a href="results.asp?meet_id=<%=lMeetID%>&amp;race_id=<%=lRaceID%>&amp;team_ind=ind">View Individual Results</a>
                                            </div>
                                        <%End If%>
                                    <%Else%>
                                        <div class="form-group">
                                            <h4>Quiet Day</h4>
                                            <p>We have no meets today.</p>
                                        </div>
                                    <%End If%>

It is currently not returning any data but I know there are two events that day.  I appreciate your help!  It seems I have a persistent issue with checking for records when executing...so much easier to open and use recordcount but, again, I need to keep it efficient
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros