Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Update a View

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
There must be an easy way to do this. I need to update a local view on a client's server with the changes I made on my test box. I can't seem to find any way to do this without manually changing the view. I must be missing something really easy here. Can I copy the SQL code and paste that into the "Live" database view?

Auguy
Northwest Ohio
 
Auguy,

Are you talking about local views within a VFP DBC (as opposed to a back-end database like SQL Server)?

If so, yes, you can copy and paste the SQL code. Just open the view in the View Designer, and go to Query / View SQL.

But this will only work in recent versions of VFP. Before about 8.0 (or might have been 7.0) the SQL code was read-only.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thanks Mike, that will work. Yes it is in a VFP 9.0 DBC

Auguy
Northwest Ohio
 
Do not attempt simple copy&paste. You would be copying only the SQL then. A view has more properties than that recorded in a DBC. Instead you can update the DBC with a copy of yours. Or you could use:

Code:
do home()+'tools\gendbc\gendbc'

to get programmatic creation of your database. From generated code you can get the part that creates your view(s), drop the view(s) on production and add using that code.


Cetin Basoz
MS Foxpro MVP, MCP
 
Yes, Cetin, but still there is only CREATE VIEW, not ALTER VIEW. So you'd need the section of gendbc created code, which creates the view and before that would delete the old view by DROP VIEW.

Bye, Olaf.
 
Yes Olaf, that is what I said - or at least I thought that I did:)

Cetin Basoz
MS Foxpro MVP, MCP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top