HI Jojo,
Thank you for you relpy again, it most helpful for me.
I want to know more about the SKIP, EOF(), BOF()
There is the PRODID list in datagase ( 20000 records )
P001
P002
P003 <-- current records
P004
P005
Is it correct to SKIP 1 (search the next record) from CURRENT RECORD, everytime ?
== Not applicable to fetch all records then skip every time unless you really need the entire records to be fetch from your remote database.
You can issue skip since you have the result sets in a cursor but better use copy to and save to a temporary tables for faster record manipulation instead of the cursor.
*****
SQLEXEC(Con, 'SELECT PRODID FROM PRODUCTS ORDER BY PRODID','RV_PRODUCTS')
SELE RV_PRODUCTS
SEEK CURR_PRODID
SKIP -1
If searching records, better retrieved the only records you want, because fetching a 20,000 records from a remote data source will be a little bit slower compared in retrieving the exact record you want..
let say you want search from your products table the product id P005, you can issue this command,
mProdid = Thisform.search.value
= SQLSETPROP(lnConnHandle, 'asynchronous', .F.)
= SQLEXEC(lnConnHandle, 'SELECT * FROM PRODUCTS WHERE PRODID = ?mPRODID', 'RV_PRODUCTS')
= SQLCANCEL(lnConnHandle)
= SQLDISCONNECT(lnConnHandle)
SELECT RV_PRODUCTS
IF !EOF() .OR. !BOF()
Else Messagebox("No Matching Records!,0+16,"Search",1900)
ENDIF