ADO Sql and Requery

Post Reply
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

ADO Sql and Requery

Post by Jack »

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

Post by Rick Lipkin »

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
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

Post by Jack »

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 ?
Post Reply