Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

VO DbServer:SetOrder Issue! 30 Jan 2020 06:22 #12969

  • Jamal
  • Jamal's Avatar
  • Topic Author


  • Posts: 305
  • Hi All,

    All of a sudden the DBServer:SetOrder(cTag) is failing. I tried the code in another VO machine and it is not working there either.

    If anyone can test and see if it works on your side. May be I am missing something obvious, but I just cannot see anything wrong with the code.
    Please see attached Terminal app test which includes a sample DBF and a CDX.
    BTW, the same DBF file and its CDX open fine in cmVODbx dbf manager app and I can see the tag and index expression. It works fine in X# sample app.

    Environment: VO 2.8 SP4 (2838), Windows 10 Pro.

    VO Code:
    FUNCTION Start()   
    local ok as logic
    local oDB as DbServer
      		
     	SetAnsi(true)  
     	SetInternational(#Windows) 
    
    	RddSetDefault("DBFCDX")     
    	
    	RDDINFO(_SET_AUTOOPEN, true)
    	RDDINFO(_SET_AUTOORDER, 1)
    	   
    	oDB := DbServer{"c:\testDbServer\airline.dbf", true, false, "DBFCDX"}
    
    	AltD()
    	
    	if oDB:Used  // dbf opens and but in the VO Debuger the WorkAreas, the Current Order amd Current Index Expression are both showing as [b]n/a[/b] !! 
    	
    		ok := oDB:SetOrder("AIRLINE", "AIRLINE")
    		
    		
    		? "SetOrder Result: ", ok   
    		
    		oDB:Gotop()
    		
    		? oDB:LastRec  // return correct number of records. 
    		
    		IF !oDB:SetOrder("AIRLINE")  // fails
    			? "SetOrder FAILED"
    		ELSE
    			? "ok"
    		ENDIF
    	
    		oDB:Close()
    	endif
    	
    	WAIT 	
    RETURN NIL	

    Please Log in or Create an account to join the conversation.

    Last edit: by Jamal.

    VO DbServer:SetOrder Issue! 30 Jan 2020 08:14 #12970

    • Karl-Heinz
    • Karl-Heinz's Avatar


  • Posts: 774
  • Hi Jamal,

    The problem is the !Deleted() For condition. Your cmVODbx and my DBMax knows this function, but your app doesn´t. The index is opened when i add :

    EXTERNAL Deleted

    to your aef.

    regards
    Karl-Heinz

    Please Log in or Create an account to join the conversation.

    VO DbServer:SetOrder Issue! 30 Jan 2020 16:26 #12979

    • Jamal
    • Jamal's Avatar
    • Topic Author


  • Posts: 305
  • Hi Karl,

    Thanks a lot, that worked. I forgot that the EXTERNAL statement ever existed in VO!
    So, I did a search in my VO repo, and found that In another app, I had ReportPro which the deleted function and many others like DTos were linked via rpForceLink().

    Jamal

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1