Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

GetRows(), Part 2

Posted on 2013-11-23
2
Medium Priority
?
349 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

609 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