Page 1 of 2
					
				Issue with ADS index
				Posted: Thu Oct 06, 2016 11:43 am
				by omni
				Roger,
Still trying to figure this out. On the new ADS client, they have 40-50 users utilizing the same menu option, not an issue, but just to let you know the volume. About once an hour, a user or two will get our system error that the index does not match the database, a function we have used (with your help) for many years to catch bad indexes, or indexes being overwritten. Stops the program after a user message.
select ratebase
set filter to
SET SCOPETOP TO
SET SCOPEBOTTOM TO
set order to ratebase
Message states that tag ratebase is missing from oppro.cdx. (what??).
We had to add the set order to ratebase because in some rare cases the tag ratenum was open and cause a matching error to the seek. Apparently XBASE does not care when that happens (non matching seek).
Have you ever seen the wrong named index file attached to a database? Cannot be done as far as I know.
Any thoughts?
I did notice that on ADS they had 100 databases configured and 110-125 open. Not sure how ADS handles that situation. Work areas were slightly less than configured.
Fred
Omni
			 
			
					
				Re: Issue with ADS index
				Posted: Thu Oct 06, 2016 12:51 pm
				by rdonnay
				I need to know more about the message.
Who is the author of this message?
It doesn't sound like anything from Advantage or ADSDBE?
Is this one of your messages from your source code?
If you are not sure, then you can press Alt-C to cancel while the message is being displayed.
This will write call stack info to XPPFATAL.LOG.
			 
			
					
				Re: Issue with ADS index
				Posted: Thu Oct 06, 2016 1:24 pm
				by omni
				Its ours, which you helped use with many years ago to give the user the message if the index is missing, which also helps us in those cases.
Below is the source. Always has worked for us in xbase. We change indexes all the time, so unsure why in this one place it causes a problem.
I think it replaces yours in dclipx to just change our message, but not sure. Cannot find it in any source, just the dll.
I tried to remove this function but then our source would not compile. Its in our system .ch file you did for us back 100 years ago.
Here is the portion of our .ch. 
*****************************************
#command  SET ORDER TO <(xOrder)> ;
                   [IN <(cOrdBag)>] ;
     =>  ordSetFocus( <(xOrder)> [, <(cOrdBag)>] ) ;
     [; SetTagOrder(<(xOrder)>, alias() + '.CDX')]
*****************************************
FUNCTION SetTagOrder( cOrder,cIndex )
OrdSetFocus(cOrder)
IF Upper(OrdSetFocus()) # upper(cOrder)
IF IsFunction('DC_WaitOnObject')
aWaitOn := DC_Do('DC_WaitOnObject()')
IF Valtype(aWaitOn) == 'A'
DC_Impl(aWaitOn)
ENDIF
ENDIF
DC_GuiAlert(,'Tag ' + cOrder + ' is missing from ' + cIndex+'.;Program will be Terminated' ,,14,"Error Warning",,,{"9.Arial Bold","9.Arial Bold" })
        close all
        Break()
RETURN .f.
ENDIF
RETURN .t.
			 
			
					
				Re: Issue with ADS index
				Posted: Thu Oct 06, 2016 1:49 pm
				by rdonnay
				Well it looks like it tests to make sure that an order is selected by it's tag name.
If the tag name doesn't exist then the message is displayed.
Have you determined if the tag name DOES exist?
What is the problem?
			 
			
					
				Re: Issue with ADS index
				Posted: Thu Oct 06, 2016 3:11 pm
				by omni
				If you look at the original remarks. the file ratebase is open already, and we just set order to ratebase, its main index.
The error states that ratebase is not a valid index for oppro.cdx.That is another file that is open in another area. Does not make sense.
That could only occur if we had select oppro, and set order to ratebase right under it.
It happens about once every 100 times or less, and usually 2 or 3 at once. then its quiet for an hour or two.
Its apparently only in this one location. That command is in two programs about 10 times in that exact order, just the few lines of code as the index changes based on need.
I am removing for them the return .f. and close on that functionb, as it appears to go on fine if that is removed, as if always true and index is ok.
odd,odd,odd.
Fred
			 
			
					
				Re: Issue with ADS index
				Posted: Fri Oct 07, 2016 9:05 am
				by omni
				Below is the lines of code:
**********************************
select ratebase
set filter to
SET SCOPETOP TO
SET SCOPEBOTTOM TO
set order to
set order to ratebase
goto top
seek str(vdpayorcod,6)
********************************
Now look at the error log: Shows oppro is the alias, not ratebase. As if the oppro alias name is oppro, which it is not as you can see on the error log.
Ratebase is in area 14 and has another index tag open. If we do not reset the index then it gives an error on the seek.
Its not as if the command is ignored. The commands before it is validating an id in the payor file, area 1 on the error log. so the select is just wrong(?).
I have made a change for them to change the select on that line to select 14 instead of ratebase to see if that will stop the errors. If so, great, but still does not explain how the select area does not function properly
 
                    AMERICAN EAGLE LOGISTICS,LLC                    LOG# ____________
ERROR LOG of "T:\oiswin.ads\OPMENU.EXE" Date: 10/07/2016 10:42:10
Xbase++ version     : Xbase++ (R) Version 2.00.554
eXPress++ version   : eXPress++ (c) Version 2.0.262
Operating system    : Windows Server 2008 R2 06.01 Build 07601 Service Pack 1
Operating system    : Windows Server 2008 R2 06.01 Build 07601 Service Pack 1
Database path       : Z:\oiswin
Default Directory   : Z:\oiswin
Current Directory   : Z:\oiswin
User                : STEPHANIECLANTON        
ERROR OBJECT:
oError:args         :
          -> VALTYPE: C VALUE: 104340
          -> VALTYPE: U VALUE: NIL
oError:description  : Operating system error
oError:filename     : 
oError:genCode      :         40
oError:operation    : DbSeek
CALLSTACK:
Called from VALIDATEPAYR(3357)
Called from (B)BOOKWIN(1311)
Called from DC_GETVALIDATE(8624)
Called from DC_GETLIST:EVENTLOOP(4657)
Called from DC_GETLIST:READGUI(3871)
Called from DC_READGUI(113)
Called from BOOKWIN(1663)
Called from (B)MAIN(824)
Called from (B)MDIBLOCK(4461)
WORKAREA STATUS:
 Area Alias         Record     Index        Order      Eof Bof Del Found
   1  PAYOR          435/3593    PAYOR.cdx    PAYOR      No  No  No  Yes
   2  SHIPPER      24680/24679   SHIPPER.cdx  SHIPPER    Yes No  No  No 
*  3  OPPRO       516054/530209  OPPRO.cdx    OPPRO      No  No  No  No 
   4  OPSTOP       67604/67605   OPSTOP.cdx   ORDSEQ     Yes No  No  No 
   5  OPBILL     1343898/1343899 OPBILL.cdx   OPBILL     No  No  No  Yes
   6  OPCOMDTY         1/70      OPCOMDTY.cdx OPCOMDTY   No  No  No  Yes
   9  OPMOVE      509431/509431  OPMOVE.cdx   OPMOVE     No  No  No  No 
  10  OPCONTRL        21/30      OPCONTRL.cdx CONTROLCOD No  No  No  Yes
  11  COMPANY          1/1       COMPANY.cdx  CODE       No  No  No  No 
  12  STATECD          5/18      STATECD.cdx  STATE      No  No  No  Yes
  14  RATEBASE    136345/136344  RATEBASE.cdx TRCTYPE    Yes No  No  No 
  20  TRACTOR       1913/4276    TRACTOR.cdx  TRACTOR    No  No  No  Yes
  21  OPSTATUS         1/21610   OPSTATUS.cdx PRONUMBER  No  No  No  Yes
  22  DRIVER         481/2936    DRIVER.cdx   DRIVER     No  No  No  Yes
  23  TRAILER          1/2839    TRAILER.cdx  TRAILER    No  No  No  No 
  24  CNTRL214         1/0       CNTRL214.cdx PAYOR      Yes Yes No  Yes
  25  CITY        197538/304246  CITY.cdx     CITY       No  No  No  Yes
  26  MULTIPO          1/0       MULTIPO.cdx  STOPSEQ    Yes Yes No  Yes
  28  DIVISION        19/85      DIVISION.cdx DIVISION   No  No  No  Yes
  29  RATETBLE       994/25201   RATETBLE.cdx RATETABL   No  No  No  No 
  30  OPMASTER         1/118     OPMASTER.cdx OPMASTER   No  No  No  Yes
  31  OPAREACD         2/11      OPAREACD.cdx OACODE     No  No  No  Yes
  32  SPCINSTR     76231/76230   SPCINSTR.cdx PRONUM     Yes No  No  No 
  33  RECEIVE      13009/20911   RECEIVE.cdx  RECEIVE    No  No  No  No 
  34  EQFILE           1/0       EQFILE.cdx   EQFILE     Yes Yes No  Yes
  35  OPEQUIP          1/0       OPEQUIP.cdx  OPEQUIP    Yes Yes No  Yes
  36  APPTTYPE         1/6       APPTTYPE.cdx APPTTYPE   No  No  No  Yes
  38  EDICNTRL         1/28      EDICNTRL.cdx EDIPAYOR   No  No  No  Yes
  39  TARIFF           1/50004   TARIFF.cdx   TARIFF     No  No  No  Yes
  51  FSCPAYOR      4163/5643    FSCPAYOR.cdx EQTYPE     No  No  No  No 
  52  FSCFUEL       2089/2112    FSCFUEL.cdx  FSCFUEL    No  No  No  No 
  54  DISPATCH       249/289     DISPATCH.cdx DISPATCH   No  No  No  Yes
  55  XREFCNTY        15/14      XREFCNTY.cdx CITY       Yes No  No  No 
  56  XREFMLG          3/2       XREFMLG.cdx  STATE      Yes No  No  No 
  59  OPTIMES      18980/18980   OPTIMES.cdx  PRO        No  No  No  No 
  61  PAYRCERT         2/1       PAYRCERT.cdx PAYRCERT   Yes No  No  No 
  62  DRVCERT          2/640     DRVCERT.cdx  DRVCERT    No  No  No  Yes
  63  ASSEDETL    135012/135013  ASSEDETL.cdx ASSEDETL   Yes No  No  No 
  65  OWNER            1/3243    OWNER.cdx    OWNER      No  No  No  Yes
  67  CONTACT          1/12169   CONTACT.cdx  CONTACT    No  No  No  Yes
  68  ARATES        2924/2923    ARATES.cdx   ARATES     Yes No  No  No 
  69  RATEOVER         1/2100    RATEOVER.cdx RATEOVER   No  No  No  Yes
  71  ADDMLS1          1/0       ADDMLS1.cdx  CITY       Yes Yes No  No 
  78  ADDMLS       87436/87435   ADDMLS.cdx   ADDMLS     Yes No  No  No
			 
			
					
				Re: Issue with ADS index
				Posted: Fri Oct 07, 2016 9:14 am
				by rdonnay
				I have never seen Xbase++ fail on a SELECT command.
If you have SELECT ratebase in your code, then ratebase should be the selected work area.
I NEVER use the SELECT command in my code,
I ALWAYS use full Aliasing.
It prevents problems like this.
RATEBASE->(dbClearFilter())
RATEBASE->(DC_ClearScope())
RATEBASE->(OrdSetFocus('RATEBASE'))
RATEBASE->(dbGoTop())
RATEBASE->(dbSeek(str(vdpayorcod,6)))
			 
			
					
				Re: Issue with ADS index
				Posted: Sat Oct 08, 2016 4:44 pm
				by omni
				I am with your. In 20 years I have never, ever seen an error on a select database. But here it is happening. Even the error log show oppro selected after select ratebase. Change to select instead of the alias/file did not help. Same issue, even though 14 clearly show ratebase.
I have now changed to close and reopen, but not hopeful. Next step is to turn off this feature. The user is getting frustrated. The check here is only to change the color on some fonts.
Frustrated.....
			 
			
					
				Re: Issue with ADS index
				Posted: Sun Oct 09, 2016 7:27 am
				by rdonnay
				Try changing your code to my aliased suggestion.
			 
			
					
				Re: Issue with ADS index
				Posted: Mon Oct 10, 2016 8:04 am
				by bwolfsohn
				omni wrote:select ratebase
set filter to
SET SCOPETOP TO
SET SCOPEBOTTOM TO
set order to ratebase
Message states that tag ratebase is missing from oppro.cdx. (what??).
Fred,
I think roger's suggestion to use aliased functions is an excellent idea...
When i looked at your code, the line that jumped out at me was the set order to...
there's no need for it, only the set order to ratebase..
While this should never be a problem, when you are hitting the error, i suspect the set order to command has had unintended consequences...