Hi,
I would write some pice of code in the XXFW.VCX/ctrApp.AfterOpenMainDatabase()-Method like this:
*
* check, to see if an Update is necessary
*
IF NOT VARTYPE(OMETA) = "O"
*
* no SDT available
*
RETURN .T.
ENDIF
IF FILE("UPDATE.TXT")) AND oMeta.oSDTMgr.NeedUpdate()
WAIT WINDOW "Refreshing Structures ..." NOWAIT
oMeta.oSDTMgr.Update()
ENDIF
WAIT CLEAR
RETURN .T.
If you have a file named "UPDATE.TXT" in your program-directory your structures are controlled and if necessary updated, otherwise the program starts without that check.
I hope that these few lines will help you.
Franz
>I am curious about how & when developers call the StoneField NEEDUPDATE / UPDATE functions in their app when new tables/fields are added to the database. (same with REINDEX - when and where?)
>
>I see postings where users hang an UPDATE DATABASE option off the menu. I would think its needed at app startup time. I am sure users would run an option in an updated EXE that references a new field or new table BEFORE the UPDATE process had been run.
>
>Are there reasons why i would NOT want to fire NEEDUPDATE/UPDATE at app startup?
>
>Also, being "userguide-challenged", can anyone forward example code they have for calling NEEDUPDATE/UPDATE at app startup - particularly in a MAXFRAME environment?? (what class/method is best to call it from?) I have read and re-read drew's comments (and Doug's) but i must be missing something. I'm sure its not operator error :)
>
>TIA
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only