Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why wouldn't i want NeedUpdate/Update run at APP startup
Message
From
24/08/2000 16:20:27
 
 
To
24/08/2000 15:17:30
General information
Forum:
Visual FoxPro
Category:
Stonefield
Miscellaneous
Thread ID:
00408957
Message ID:
00408992
Views:
15
>Are there reasons why i would NOT want to fire NEEDUPDATE/UPDATE at app startup?

Only that it takes time to go through the database and check each table. You're probably better off devising some mechanism for telling the app at startup that an update is needed, then use SDT's NeedUpdate to figure out which specific tables need updating. One simple way to do this is to have your app check for the existence of a file with some predetermined name at startup, and call the update method only if that file exists. When the database needs to be updated, simply create that file. Have your update method remove the file after the update is done so the update doesn't run again until it's needed again.

>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 :)

I can't help you with MaxFrame specifically, but here's a sample of the code you can use to do the updates once you've determined that an UDPATE() is necessary.
lnTables = aDBObjects(laTables, "Table")
for lni = 1 to lnTables
   if oMeta.oSDTMgr.NeedUpdate(laTables[lni])
      oMeta.oSDTMgr.Update(laTables[lni])
   endif
endfor
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Previous
Reply
Map
View

Click here to load this message in the networking platform