Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tip of the Day --- Views (Part Two)
Message
 
To
27/09/1999 23:45:06
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00269786
Message ID:
00270103
Views:
23
>A common problem with views is that the View Designer can't handle complex views and, sometimes, we want to set some defaults for the view through DBSETPROP or CURSORSETPROP that we want to remain persistant, that is, always in effect unless otherwise overridden.
>
>So, what to do? Well, there's a neat tool that generates code that can reconstruct a database. It's called GENDBC and resides in \VFP98\TOOLS\GENDBC. Running GENDBC producers a PRG that can rebuild the DBC. This is step one.
>
>Step two is to take the PRG that GENDBC created and strip out everything that's not a view. This leaves nothing but view definition code. Now, go into that code and modified the DBSETPROPs functions as desired. Make sure that you have the command OPEN DATABASE myDBC EXCLUSIVE as the first line and CLOSE DATA as the last line of the PRG.
>
>Now save the PRG in the directory where your data resides. Call it GenViews. Easy enough.
>
>Now, everytime that circumstances call for a change to a view or you want to experiment with a view setting or structure, just modify GenViews as appropriate and rerun it. That's it!
>
>Works everytime and it's a big time saver, not to mention a great debugging tool for those problem views.

John,
Good tip. However, I reccomend using GenDbcX instead of GenDbc. GenDbc has problems with complicated databases and creates a prg that's too large to compile. GenDbcX breaks down the code to recreate the DB into seperate methods.
You can call individual methods to recreate any individual table, view, etc. It also has a CreateViews method that will recreate all views. You don't have to go to the trouble of striping that code out of the GenDbc output. You just instantiate the class created by GenDbcX and call the CreateViews method.

GenDbcX is available on Steve Arnott's website http://www.stevearnott.com/
Steve Ruhl
CitiMortgage, Inc.
steven.ruhl@citibank.com Office
Steve@steven-ruhl.com Home
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform