Need Help

26 views
Skip to first unread message

hema...@gmail.com

unread,
Jun 27, 2025, 1:13:19 AMJun 27
to ADO Harbour
Hello All Guru

I am executing following code and getting only 1 row instead of 2k+ rows. Not sure what Iam doing wrong

    oRs := AdoDB("SELECT xs_rcode AS ID ,xs_rname AS NAME from xs_receiver")
    oTBrowse := TBrowse():new( 2,2, MaxRow()-2, MaxCol()-2 )
    oTBrowse:headSep := "-"
    oTBrowse:colorSpec := "N/BG,W+/R"
   For n := 1 TO oRs:oRs:Fields:Count()

oCol := TBColumnNew( oRs:FieldName(n), &("{|| IF( oRs:RecCount() = 0, '', oRs:FieldGet("+STR(n)+")) }") )
        oTBrowse:AddColumn( oCol )        
   
    Next n

   DO WHILE .T.
      oTBrowse:forceStable()
      nKey := Inkey(0)
      IF oTBrowse:applyKey( nKey ) == TBR_EXIT
         EXIT
      ENDIF
   ENDDO

Please guide me. 

Thank you very much for your help in advance.

Regards
Hemant

Francesco Perillo

unread,
Jun 27, 2025, 2:10:44 AMJun 27
to ado-h...@googlegroups.com
I dont't know ADO and I'm quite sure TBrowse doesn't know about ADO too.

So you have to use a specialized browse class or must tell TBrowse how to skip records

--
Has recibido este mensaje porque estás suscrito al grupo "ADO Harbour" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a ado-harbour...@googlegroups.com.
Para ver este debate, visita https://groups.google.com/d/msgid/ado-harbour/a6c44d42-1d65-48bd-9872-28c0f8ac6904n%40googlegroups.com.
Message has been deleted

hema...@gmail.com

unread,
Jun 27, 2025, 7:55:47 PMJun 27
to ADO Harbour
Thank you for guidance much appreciated.   

Added following code and  Problem Solved
   WITH OBJECT oTBrowse
      :GoTopBlock    := {|| If( oRs:RecCount() > 0, oRs:GoTop(), NIL ) }
      :GoBottomBlock := {|| If( oRs:RecCount() > 0, oRs:GoBottom(), nil )  }
      :SkipBlock     := {| n | oRs:Skipper( n ) }
   END

Regards
Hemant


Reply all
Reply to author
Forward
0 new messages