Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to create an SQL view in a prg
Message
 
 
To
05/06/1998 12:06:49
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00105076
Message ID:
00105292
Views:
38
Sylvia,

>Thanks, I saw your program a few days ago, but wasn't sure exactly what it was for. I guess I need to ask a few follow-up questons. Am I correct in that your syntax above creates the view itself, but it's barren of table specific stuff and that's what your Dbviewprop does?

Let me preface a couple of things. The only views I code are readonly views where the view designer can't do it like I want, the view I posted has two joins to the same lookup table for example. My updateable views are all simple parameterized views of a single table so the VD handles them just fine.

What dbcviewprop does is copy the "field level" items like Caption and Field Mapping from the table.field to view.field. So that when the view fields are dragged onto a form the correct controls are dropped on the form.

On my website I added an article and a slightly updated version of dbcViewProp just a few minutes ago.

> Also, I'm not sure I understand what you mean when you say "If I ever change a view, I just highlight that section of code, rightclick and tell it to Execute Selection." What exactly does this accomplish?

Say I add or remove a field from the view, I go in make the code change, then in the code window highlight the chunk of code for that CREATE SQL VIEW, the rightclick menu has an "execute selection" item, that'll just run the code you have selected. So instead of recreating all the views stored in that one prg only the one view that I modified is updated in the database.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform