After a lot of trial and error, web searches and head banging I found that when using ADS Local, Indexes are not done the same as standard xHarbour indexes.
With xHarbour, an index can be done as follows:
INDEX ON Test->Field1 TO C:\Test FOR Test->Field2 = cSomeStringWith ADS Local, you cannot use cSomeString. I found this on the ADS website:
Memory variables do not work in expressions sent to the Advantage Database Server. This is applicable with filter or index expressions. The expression that is used for filtering or indexing must have all macros expanded prior to sending the expression text to the server
They give an example of how to get around this:
Solution:
Use the & symbol to expand macro values.
Below is a simple console application that demonstrates how to macro expand date variables in CA Visual Objects when used in a filter expression:
----------------
FUNCTION MemFilter()
LOCAL dbs AS DbServer
FIELD empid, first, last, hiredate
STATIC dDate AS DATE // won't macro-expand
MEMVAR cDate AS STRING // will macro-expand
dbs := DBServer{"\\ufo\recreate\dirke\VO2\scopes\master",DBSHARED,,"AXDBFCDX"}
dDate := CToD('10/01/98')
cDate := DToC(dDate)
? "SetFilter: "
? dbs:SetFilter(StrEvaluate('HIREDATE = CTOD("&cDate")')) <<<<<Here is their work around
WAIT
dbs:GoTop()
? "Filtered view: "
DO WHILE !(dbs:EOF)
? dbs:first,dbs:last,dbs:empid, dbs:hiredate
dbs:Skip()
ENDDO
wait
If I try replacing cSomeText with "&cSomeText" it still does not work.
Dose anyone know how to make this work?
I need to use ADS Local as I am using their table encryption.
Jeff Barnes
(FWH 16.11, xHarbour 1.2.3, Bcc730)