Antonio, please send to my email office(at)byte-one.com a short description from the way you process indexes with UDFs! I will try to help you to ident the problem.
Good Night!
TESTADISC->(dbsetorder(1))
TESTADISC->(dbgoto(TESTADISC->(lastrec()+1)))
//TESTADISC->(dbsetorder(1))
//TESTADISC->(dbsetorder(1))
TESTADISC->(dbgoto(TESTADISC->(lastrec()+1)))
TESTADISC->(dbsetorder(1))
function rev2to2(cTausch) // tauscht 3 u. 4 mit 1 u. 2
return subs(cTausch,3,2) + subs(cTausch,1,2)
STATIC FUNCTION ADOUDFINDEX( nWa, xExpression, xCondition, lUnique, lDesc, bEval,;
nEvery, xWhile, aBookMarks, cExpression )
LOCAL oRecordSet := USRRDD_AREADATA( nWA )[ WA_RECORDSET ]
//LOCAL aWAData := USRRDD_AREADATA( nWA )
LOCAL lRetVal := .F.
LOCAL aUdfs := ListUdfs(), n
LOCAL bIndexExprn, bFilterCond, nDecimals, bWhile, nStart := 1
LOCAL xEvaluated
bEval := IF( bEval == NIL, { || .T. }, bEval )
nEvery := IF( nEvery == NIL, 0, nEvery )
cEXpression := IF( cExpression = NIL, cExpression := xExpression, cEXpression )
IF ! EMPTY( aUdfs )
FOR n := 1 TO LEN( aUdfs )
IF AT( aUdfs[ n ], UPPER(cExpression) ) > 0
lRetval := .T.
EXIT
ENDIF
NEXT
ENDIF
IF ! EMPTY( xCondition ) .OR. ! EMPTY( xWhile )
lRetVal = .T.
ENDIF
IF lRetVal //.OR. PROCNAME( 1 ) = "ADO_ORDCREATE"
IF PROCNAME( 1 ) <> "ADO_ORDCREATE" //CAN BE SUBINDEX CREATION
oRecordSet:Filter := ""
oRecordSet:Sort := ADO_GET_FIELD_RECNO( USRRDD_AREADATA( nWA )[ WA_TABLEINDEX ] )
ENDIF
aBookMarks :={}
IF !EMPTY( xWhile )
nStart := 0
ENDIF
xWhile := IF( EMPTY( xWhile ), ".T.", xWhile )
xCondition := IF( EMPTY( xCondition ), ".T.", xCondition )
IF VALTYPE( xExpression ) = "B"
bIndexExprn := xExpression
ELSE
bIndexExprn := &("{ || " + xExpression + "}")
ENDIF
IF VALTYPE( xCondition ) = "B"
bFilterCond := xCondition
ELSE
bFilterCond := &("{ || " + xCondition + "}")
ENDIF
IF VALTYPE( xWhile ) = "B"
bWhile := xWhile
ELSE
bWhile := &("{ || " + xWhile + "}")
ENDIF
nDecimals := SET( _SET_DECIMALS, 0 )
n := 0
IF nStart > 0 .AND. !ADOEMPTYSET( oRecordSet )
ADO_GOTOP( nWA )
ENDIF
DO WHILE EVAL (bWhile ) .AND. !oRecordSet:Eof()
IF nEvery > 0
n++
IF n = nEvery
EVAL( bEval )
n := 0
ENDIF
ENDIF
xEvaluated := EVAL( bIndexExprn )
IF lUnique
IF ASCAN( aBookMarks,;
{|x| SUBSTR( x[ 2 ], 1, LEN( xEvaluated ) ) = xEvaluated } ) = 0
IF EVAL( bFilterCond )
AADD( aBookMarks, { oRecordSet:BookMark, xEvaluated } )
ENDIF
ENDIF
ELSE
IF EVAL( bFilterCond )
AADD( aBookMarks, { oRecordSet:BookMark, xEvaluated } )
ENDIF
ENDIF
oRecordSet:MoveNext()
ENDDO
SET( _SET_DECIMALS, nDecimals )
IF lDesc
ASORT( aBookMarks, NIL, NIL, { |x,y| x[ 2 ] > y[ 2 ] } )
ELSE
ASORT( aBookMarks, NIL, NIL, { |x,y| x[ 2 ] < y[ 2 ] } )
ENDIF
// only with set focus these bookmarks become active
lRetVal := .T.
ELSE
lRetVal := .F.
ENDIF
RETURN lRetVal
Error description: Error BASE/1123 Argument error: AADD
Args:
[ 1] = U
[ 2] = A { ... }
Stack Calls
===========
Called from: => AADD( 0 )
Called from: C:\adordd\adordd.prg => ADO_ADDLISTFIELDLOGICAL( 4931 )
Called from: C:\adordd\adordd.prg => ADOSTRUCTTOSQL( 4799 )
Called from: C:\adordd\adordd.prg => ADO_CREATE( 4608 )
FUNCTION ListFieldLogical( alist )
STATIC aListFieldLogical := {}
FUNCTION ADOSHOWERROR( oCn, cTable, lSilent )
LOCAL nErr, oErr, cErr
DEFAULT oCn TO oConnection
DEFAULT lSilent TO .F.
DEFAULT cTable TO ""
IF ( nErr := oCn:Errors:Count ) > 0
oErr := oCn:Errors( nErr - 1 )
IF ! lSilent
WITH OBJECT oErr
cErr := 'Table: ' + cTable
cErr += CRLF + CRLF + oErr:Description
cErr += CRLF + 'Source : ' + oErr:Source
cErr += CRLF + 'NativeError : ' + cValToChar( oErr:NativeError )
cErr += CRLF + 'Error Source : ' + oErr:Source
cErr += CRLF + 'Sql State : ' + oErr:SQLState
cErr += CRLF + REPLICATE( '-', 50 )
cErr += CRLF + PROCNAME( 1 ) + "( " + cValToChar( PROCLINE( 1 ) ) + " )"
cErr += CRLF + PROCNAME( 2 ) + "( " + cValToChar( PROCLINE( 2 ) ) + " )"
cErr += CRLF + PROCNAME( 3 ) + "( " + cValToChar( PROCLINE( 3 ) ) + " )"
cErr += CRLF + PROCNAME( 4 ) + "( " + cValToChar( PROCLINE( 4 ) ) + " )"
cErr += CRLF + PROCNAME( 5 ) + "( " + cValToChar( PROCLINE( 5 ) ) + " )"
cErr += CRLF + PROCNAME( 6 ) + "( " + cValToChar( PROCLINE( 6 ) ) + " )"
cErr += CRLF + PROCNAME( 7 ) + "( " + cValToChar( PROCLINE( 7 ) ) + " )"
MSGALERT( cErr, IF( oCn:Provider = NIL, "ADO ERROR",oCn:Provider ) )
END
ENDIF
ELSE
MSGALERT( "ADO ERROR UNKNOWN"+;
CRLF + PROCNAME( 1 ) + "( " + cValToChar( PROCLINE( 1 ) ) + " )" + ;
CRLF + PROCNAME( 2 ) + "( " + cValToChar( PROCLINE( 2 ) ) + " )" + ;
CRLF + PROCNAME( 3 ) + "( " + cValToChar( PROCLINE( 3 ) ) + " )" + ;
CRLF + PROCNAME( 4 ) + "( " + cValToChar( PROCLINE( 4 ) ) + " )" + ;
CRLF + PROCNAME( 5 ) + "( " + cValToChar( PROCLINE( 5 ) ) + " )" + ;
CRLF + PROCNAME( 6 ) + "( " + cValToChar( PROCLINE( 6 ) ) + " )" + ;
CRLF + PROCNAME( 7 ) + "( " + cValToChar( PROCLINE( 7 ) ) )
ENDIF
RETURN oErr
WITH OBJECT oErr
cErr := IF( !EMPTY( cTable ),'Table: ' + cTable +CRLF + CRLF ,"")
cErr += oErr:Description
In ADOPREOPENTHRESHOLD() not only the size in records should work as a filter.
Also a substring (or a array with substrings) of the tablename are interesting for filtering
the DBs for pre-open! (ex. only "2015" -> DB2015 and Faw2015gt and Klima2015 and ......)
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 36 guests