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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Base Table Changed in View: Error 1

Status
Not open for further replies.

SleepDepD

Programmer
Mar 13, 2004
65
0
0
US
Working in VFP 7.0, I got the error message "Base table fields have changed and no longer match view fields. View field properties cannot be set."

I'm working on a "update" EXE for my deployed application--it updates some tables, adding new fields, etc. I looked at the definition for the erroring view and it has "mytable.*"--since fields were added to "mytable" I'm pretty sure that's why I'm getting an error. My question is how I do "refresh" the view? Do I have to delete it and recreate it? The solution I'm looking for must be something I can do in my VFP "Update.EXE". Appreciate the help.
 
Hi,

You're correct when you say the root of the problem is the select * in the view definition. I would avoid using select * in view definition.

I would create the views with a predefined list of fields eg
select field1, field2,field2 from table

this way when you add field4 to the table your view doesn't 'blow up'

I have a viewgenerator.prg type program that contains all the view definition in code.

one thing you could do is create a view definition program with the create sql view commands in it and build it into an update exe, send it to the client and get them to run it on site.

I wouldn't use 'select *'

Mark


 
markdenby,

Thank you for your help; this is what I'll go with.

I took your advise of using a "viewgenerator.prg". The views that were getting "mytable.*", I used AFIELDS() to get all the fields names and just concatenate a string together of "mytable.field1,mytable.field2,..." to use in the SELECT statement of my view. This way all the fields are there, and it stays semi-dynamic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top