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.
ADO Sql and Requery
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
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
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
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 ?
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 ?