FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO Sql and Requery
Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
ADO Sql and Requery
Posted: Sat Mar 01, 2008 02:42 PM

With DBF files, i use a listbox in a dialog and display the records of the DBF .
If the user want to search , he press the search button and write what he is looking for

How to do the same with record set, how to requery ??

Thanks for your help .

Xbase sample:

select 0
use adresses
set index to NAME
go top
DEFINE DIALOG ...
REDEFINE LISBOX oLbx FIELDS ...
REDEFINE BUTTON .... ACTION (RESEARCH(),oLbx:upstable(),oLbx:refresh()
ACTIVATE DIALOG ...

function RESEARCH()
local av
av:=space(20)
if MsgGet (" Recherche Patient ","Search :",@av)
seek trim(av)
endif
return .T.

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
ADO Sql and Requery
Posted: Sat Mar 01, 2008 04:01 PM

I use the sort option when I have multiple search possibliities .. consider this code :

oRs:Sort := "fname"
oRs:MoveFirst()
oRs:Find("fname = '"+cFIND+"'" )

oLBX:ReFresh()
SysReFresh()

.. or

oRs:Sort := "lname"
oRs:MoveFirst()
oRs:Find("lname = '"+cFIND+"'" )

oLBX:ReFresh()
SysReFresh()

..

Rick Lipkin

Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
ADO Sql and Requery
Posted: Sun Mar 02, 2008 05:56 PM

Rick,
Thanks for this answer but what have i to to
if the date is not in the record set .
I i have a table with 1 000 000 of records or more,
i will not have : select * form table
i will place a first scope : select * form table where NAME like "J*"
and if the user want to llok for a name starting with R ...
How to refresh ?

Continue the discussion