Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Application doesn't use the correct version of the progr
Message
De
30/01/2001 16:35:30
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00470222
Message ID:
00470349
Vues:
47
>>>I found the source of the problem. Once again it's so simple, that it's strange, why it was elluding from me for so long and cost me hours of investigation :( The main application JobControl has this program included in it. Of course, it used the version, which was included in the main project and didn't bother to check my recent. Well, I recompiled this project (though it's not mine again) and now it picks up the right code.
>>
>>That was going to be my next suggestion, since you didn't find it in a procedure file.
>>
>>>The only problem left to find out, why it doesn't use Geo tag. Well, hopefully it would be easy.
>>
>>There's always one more bug. :)
>
>Well, I hoped it would be easy. Unfortunately, it's not and I spent another hour struggling with this new mystery...
>
>Let's me give you more details:
>The Main application called JobControl calls several indipendand second level applications.
>
>There is a Job Viewer Form with a grid with all jobs. I check Job to run in a grid and then hit run button. Job is supposed to run.
>This particular job, I'm having problems, consists of multiple steps. First step is Stats application (mine), then Report application.
>
>Calling OpenTable(myTable,,,"Geo") doesn't set the Geo tag. Calling it from command window sets Geo tag properly. I think (it's my pure guess, since I had another unresolved mystery with the same form), that either this form uses a timer, which reselects the Grid alias, either Grid Record Source reselects somewhere. In any case, tag Geo is not set. Now I'm going to call my colleague and tell her once again about this stupid problem. I lost couple of hours already, trying to solve not mine problem :(((((
>
>This is an OpenTable code:
>
>********************************************************************
>*  Description.......: OpenTable && Opens the passed table
>*  Calling Samples...: OpenTable('TranMstr','WorkFile')
>*  Parameter List....: tcTable, tcAlias, tcMode, tcOrder, tnBufferMode
>*  Created by........:
>*  Modified by.......: Nadya Nosonovsky 01/10/2001 11:46:19 AM
>********************************************************************
>function OpenTable
>lparameters tcTable, tcAlias, tcMode, tcOrder, tnBufferMode
>=messagebox( "tcTable "+tcTable+ chr(13)+"tcOrder "+iif(!empty(tcOrder),tcOrder,""))
>* tcTable - required: name of table to open (with or without full path)
>* tcAlias - optional: alias name, if different from tcTable
>* tcMode - optional:  mode in which table should be opened, like Shared noupdate
>* tcOrder - optional: Tag name
>* tnBufferMode - optional: Set buffer mode
>local lcTableName, lnPos, llDBCPrefix, lcDBCName
>* Check parameters first
>if empty(tcTable) or vartype(tcTable)'C'
>* First parameter is required
>     return .f.
>else
>     lnPos=rat('!',tcTable)
>     if lnPos>0 && DataBase Name was specified && example: Support!PostOff
>          lcTableName=juststem(substr(tcTable,lnPos+1)) && PostOff
>          lcDBCName=upper(left(tcTable,lnPos-1)) && DBC Name
>          llDBCPrefix=.t.
>     else
>          lcTableName=tcTable
>     endif
>endif
>if empty(tcAlias) or vartype(tcAlias)'C'
>     tcAlias=juststem(lcTableName)
>endif
>
>if empty(tcMode) or vartype(tcMode)'C'
>     tcMode='shared'
>else
>     tcMode=lower(tcMode)
>endif
>local lcCheckFile
>if empty(justext(lcTableName))
>   lcCheckFile=forceext(lcTableName,"dbf")
>else
>   lcCheckFile=lcTableName
>endif
>if !file(lcCheckFile)  && File doesn't exist
>     =messagebox(tcTable +' does not exist!. Can not proceed...',48,'Error')
>     return .f.
>endif
>local lnOldSelect
>lnOldSelect=select()
>if !used(tcAlias) or ; && Alias is not already in use or 
>        (llDBCPrefix and not juststem(cursorgetprop("DATABASE",tcAlias))==lcDBCName) && it's not the same database
>     local lcOldError, lnErr, lcOldSetExclusive
>     use in select(tcAlias) && Close table
>     lnErr=0
>     lcOldError=on('error') && Save current Error Handler
>     lcOldSetExclusive=set('exclusive') && Save current exclusive status
>     set exclusive off && This should be always set this way
>     on error lnErr=error()
>     use (tcTable) again &tcMode in 0 alias (tcAlias)
>     on error &lcOldError && Restore previous Error Handler
>     if lcOldSetExclusive='ON'
>          set exclusive on && Restore it back to original settings
>     endif
>     if lnErr0 && Error occurs
>          if lnErr=1705  && File Access is denied
>               =messagebox(tcTable +' is opened exclusively by another user. Can not proceed...',48,'Error '+transform(lnErr))
>               return .f. && Table could not be opened (already used exclusively)
>          else && Another error
>               =messagebox(tcTable+' could not be opened!',48,'Error '+transform(lnErr))
>               return .f.
>          endif
>     endif
>endif
>
>select (tcAlias) && If it's here, everything is all right
>if !empty(tcOrder)
>if not empty(tcOrder) and vartype(tcOrder)='C' and tagno(tcOrder)>0
>     set order to tag (tcOrder)
>endif
>suspend
>endif
>
>if vartype(tnBufferMode)='N' and between(tnBufferMode,1,5)
>    local lcOldSetMultilocks
>    lcOldSetMultilocks=set('multilocks')
>    set multilocks on
>     =cursorsetprop('Buffering',tnBufferMode) && Note, we can not set buffering mode less than 3 on a view - no check for this
>     if lcOldSetMultilocks="OFF"
>          set multilocks off && Restore back
>     endif
>endif
>select (lnOldSelect) && Return back to the original area
>
>return .t.
Maybe you could use the "SET ORDER TO TAG whatever IN wherever" format of the command. That way, it won't matter what the current area is when you get there. You might also have to change the TAG() function to use the optional area/alias, too. And other commands that might be dependant on the current area.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform