Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tip of the Day --- Views (Part Two)
Message
From
27/09/1999 23:45:06
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Tip of the Day --- Views (Part Two)
Miscellaneous
Thread ID:
00269786
Message ID:
00269786
Views:
51
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 Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Next
Reply
Map
View

Click here to load this message in the networking platform