Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2004
    Posts
    72

    Unanswered: count blank rds....

    Set DB1 = DBEngine.OpenDatabase("D:\PUBBLICA\APPLICAZIONI\AN AGRAFICA_OK_10092007.mdb")
    Set RSD1 = DB1.OpenRecordset("ANAGRAFICA1")

    i use this settiong in DAO...

    How to count all blank rds in filed APPELLATIVI in table ANAGRAFGICA1...?
    Tks.

  2. #2
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    Set DB1 = DBEngine.OpenDatabase("D:\PUBBLICA\APPLICAZIONI\AN AGRAFICA_OK_10092007.mdb")
    Set RSD1 = DB1.OpenRecordset("ANAGRAFICA1")
    dim mycounter as integer
    mycounter = 0
    rsd1.movefirst
    do until rsd1.eof
    if nz(rsd1!APPELLATIVI ,0) = 0 then
    mycounter = mycounter + 1
    end if
    rsd1.movenext
    loop
    rsd1.close
    msgbox "There were..." & mycounter & "...blank rows"
    Dale Houston, TX

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Is there not a .RecordCount property?
    George
    Home | Blog

  4. #4
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    yes but rst.recordcount is a count of all the records in the recordset - not every other row or blank/not blank rows.

    therefore you count the row affected which by the way is an available method in ADO
    Dale Houston, TX

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    You're quite corret Dale - I missed out on a key part of the question.

    However... If you opened a recordset of
    Code:
    SELECT APPELLATIVI
    FROM   ANAGRAFGICA1
    WHERE  APPELLATIVI IS NULL
    Then you can use the RecordCount property of the recordset without having to write a sodding loop!
    George
    Home | Blog

  6. #6
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    touche' Geo
    Dale Houston, TX

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •