Which is 'Set Filter' equavalent in Advantage RDD

Post Reply
User avatar
RAMESHBABU
Posts: 591
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Which is 'Set Filter' equavalent in Advantage RDD

Post by RAMESHBABU »

Hi

I was testing to find the fastest way to access records from a filtered
large database, using ADS RDD.

So fare I could find that the DbSetFilter() is 100 times faster than the
traditional SET FILTER TO ... command.

I was trying to filter the records with AdsSetAOF() funciton. But I found
no effect of this funciton and total records are appearing.

I give below the code. Can anybody advise me the usage of ADS
functions AdsSetFilter(), AdsSetAOF() which are related to filtering
databases.


#include "FiveWin.ch"
#include "ads.ch"

FUNCTION main()

LOCAL cFiltCond
FIELD salary, state

********

REQUEST _ADS
RddRegister( "ADS", 1 )
RddSetDefault( "ADS" )
AdsSetDeleted(.T.)
SET SERVER LOCAL
SET FILETYPE TO CDX
SET DELETED ON

*********

USE c:\fwh\samples\customer.dbf ALIAS customer
INDEX ON state TAG state TO customer
OrdSetFocus("state")

cFiltCond := "customer->salary >10000 .AND. state = 'ME'"
bFilter := "{||"+cFiltCond+"}"

* Method 1
SET FILTER TO customer->salary >10000 .AND. state = 'ME'
GO TOP
BROWSE()

DbSetFilter()
DbGoTop()

* Method 2
DbSetFilter(&bFilter, cFiltCond)
DbGoTop()
BROWSE()

DbSetFilter()
DbGoTop()

* Method 3
AdsSetAOF("c:\fwh\samples\customer.dbf",&cFiltCond)
*AdsGotoTop()
BROWSE()

RETURN nil

**********

Thanks in advance

- Ramesh Babu P
Post Reply