Kokoo:
I think I explained it to you in comp.lang.xharbour newsgroup, but here it goes again anyway:
ADS is an EXTERNAL program to your application, so, you cannot use anything related to your program to indicate filters, relations or indexes.
I mean, you cannot use alias, variables or used defined functions in the ADS or RDD related functions or comands. in order to set relations or filters, because ADS CANNOT go into your program code or memory and "inspect" the values of such variables.
kokookao2007 wrote:
LOCAL cSALSMAN:="TIM",cCOND
cCOND:="SAL->SALSMAN="+"'"+cSALSMAN+"'"
The previos expression is not valid, if you are going to use it with ADS you cannot use the "SAL" alias, because ADS cannot know what is the value of "SAL" (this is an internal pointer of your application), so, the right expression is:
LOCAL cSALSMAN:="TIM",cCOND
cCOND:="SALSMAN="+"'"+cSALSMAN+"'"
This:
USE SAL INDEX SAL_NO NEW SHARE // INDEX ON SNO
USE SAL1 INDEX SAL1_DT NEW SHARE
SET RELATION TO SAL1->SNO INTO SAL
SET SCOPE TO dDT1,dDT2
This can be valid if you want the relation be handled by the client (it could be slow).
And the problem comes here:
SET FILTER TO &cCOND // ERROR FILTER FOR "ADS" , BUT WORK FINE FOR "DBFCDX"
BROWSE()
GO TOP
As I explained to you in the xharbour news group, all the filtering stuff MUST be established in a TEXTUAL FORM, since the cCOND expression is wrong form the begining, it will sure crash when comming to this point.
This is the right way:
cCond := cCOND:="SALSMAN="+"'"+cSALSMAN+"'"
bCond := "{||"+cCond+"}"
DBSETFILTER(&bCond, cCond)
GO TOP
BROWSE()
Remember, ADS is an EXTERNAL programm running out of the cast of your application. ADS doesn't know anything about your programm enviroment and it doesn't have anyway to know about it.