Avatar of Bob Schneider
Bob SchneiderFlag for United States of America

asked on 

SQL Server/Classic ASP Execute Returning No Records

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

Open in new window


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%>

Open in new window


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
ASPSQL

Avatar of undefined
Last Comment
Scott Fell
SOLUTION
Avatar of zc2
zc2
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
ASP
ASP

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

82K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo