?
Solved

GetRows(), Part 2

Posted on 2013-11-23
2
Medium Priority
?
348 Views
Last Modified: 2013-11-23
Is there a way to use GetRows() on this...I am concerned with filtering out the records that are blank but not null:

    i = 0
    ReDim AsgndBibs(0)
    Set rs = New ADODB.Recordset
    sql = "SELECT pr.Bib FROM PartRace pr INNER JOIN RaceData rd ON pr.RaceID = rd.RaceID WHERE rd.EventID = "
    sql = sql & lEventID & " AND pr.Bib IS NOT NULL ORDER BY pr.Bib"
    rs.Open sql, conn, 1, 2
    Do While Not rs.EOF
        If Not rs(0).Value & "" = "" Then
            AsgndBibs(i) = rs(0).Value
            i = i + 1
            ReDim Preserve AsgndBibs(i)
        End If
        rs.MoveNext
    Loop
    rs.Close
    Set rs = Nothing

Open in new window

0
Comment
Question by:Bob Schneider
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 39671347
You'd be better to adapt your SQL query to filter out the blanks first, rather than pulling the results and filtering afterwards.

Change you where clause to:
sql = sql & lEventID & " AND (pr.Bib IS NOT NULL AND RTRIM(pr.Bib) = '') ORDER BY pr.Bib"

Open in new window

Then you can simply call GetRows() on the resulting recordset.
0
 

Author Closing Comment

by:Bob Schneider
ID: 39671352
Thanks!
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question