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!

Change Local View Progammatically

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
This must be fairly simple, but I can't find the answer. I have some local views I need to change through a program. I have some code to create them, but can't seem to find a command(s)/code that will allow me to add/remove fields.

Auguy
Sylvania/Toledo Ohio
 
After further review (just a joke), I think I have to recreate the entire view in code and execute the code on the customer's server. I can probaly get the entire code from scripting the db.

Auguy
Sylvania/Toledo Ohio
 
Auguy,

The usual way is to use DBGETPROP() to get the existing view definition (that is, the SQL statement that defines the view). Pass the name of the view, the word "VIEW" and the word "SQL".

You can then alter the SQL, and recreate the view, using CREATE SQL VIEW.

Could be you already discovered this for yourself, but I thought I would mention it for the sake of completeness.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Mike, thanks for the info.

Auguy
Sylvania/Toledo Ohio
 
Just a follow up. I used GENDBC to generate the program to create the DB. I copied the code in that program that generates the views I needed to a new procedure that can be run from within my exe. Worked with no problems.

Auguy
Sylvania/Toledo Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top