ADO Sql and Requery

ADO Sql and Requery

Postby Jack » Sat Mar 01, 2008 2: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.
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am

Postby Rick Lipkin » Sat Mar 01, 2008 4: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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Jack » Sun Mar 02, 2008 5: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 ?
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 76 guests