Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating classlibraries that are in use
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00602963
Message ID:
00602990
Vues:
25
Luis --

I create an EXE rather than have discrete program files which users access. So, updating is simply copying a new EXE on top of the old. This also makes it easier if you're deploying the app on client machines rather than the server. Then, you simply copy down one file to the local workstation when the user logs on.

I guess the risk of doing a live update is this. If a user happens to access a class library in the middle of your update attempt it's possible that some really screwy errors could occur.

On the other hand, I see that the code could be really useful as the basis of a batch processing mechanism (updating remote users, etc.).

Jay

>Hello Guys!,
>I don't know if this is old news, but I found a way to update class libraries and reports without interrupting the users, I tried it and it works!, this is what I do, lets say that I made some changes to a class library, then I want to update the version being in use that resides in the network, I open the old and
>new VCXs files as tables and update record by record from the new to the old one. here is a short vertion of the code :
>
>* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
>* Method Name : UpdTable *
>* Description : Update a class, report or any table with data from *
>* another table of the same structure,
>* it compares the two table record *
>* by record, and update from the source *
>* Parameters : tcFromTableName : Character, name of the source table
>* tcToTableName : Character, name of the table to be
>* Return : Numeric : 0 means sucesfull
>* Author : Luis Guzman 01/07/2002
>* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
>
>LPARAMETER tcFromTableName,;
> tcToTableName
>
>* When I say table read "VCX" or "FRX" file of a class library
>* or report
>
>LOCAL lcOldSetDeleted,;
> lnRowCounter,;
> lcCommand,;
> lnlnTotalRecords,;
> lnCurrentRecord
>
>lcOldSetDeleted=SET("DELETED")
>tcFromTableName=ALLTRIM(UPPER(tcFromTableName))
>
>SET DELETED OFF
>SELECT EVAL("tcFromTableName")
>
>lnTotalRecords=RECCOUNT(tcToTableName)
>
>DO WHILE NOT EOF()
>
> llIsDeleted=DELETED() && Check if the record is deleted
> lnCurrentRecord=RECNO() && Save the current record number
>
> SCATTER MEMVAR MEMO && Load into memory all the
> && information for that record
>
> IF lnCurrentRecord>lnTotalRecords && a new record, insert
> && a row
>
> INSERT INTO &tcToTableName FROM MEMVAR
> SELECT (tcFromTableName)
> SKIP
> LOOP
> ENDIF
>
> SELECT (tcToTableName)
> GO RECORD lnCurrentRecord && Go to the matching record
> && number
> GATHER MEMVAR MEMO
>
> IF llIsDeleted && If the record is deleted in the
> && source, delete tha record from
> DELETE && the second table
> ELSE
> RECALL
> ENDIF
>
> SELECT (tcFromTableName)
> SKIP
>
>ENDDO
>
>SELECT (tcToTableName)
>IF !EOF()
> SKIP
>ENDIF
>
>DO WHILE !EOF() && Eliminate reminning records
> DELETE
> SELECT (tcToTableName)
> SKIP
>ENDDO
>
>SET DELETE &lcOldSetDeleted
>
>* Now you can compile the class library or report and your are ready to go
>
>What do you think?, any comments?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform