> HI..
> how to update view from visual foxpro to sql server..
> I can write the in view but it is not updating in sql server table.
> I want to update related sql server Table.
>
> Thanks in Advance..
>
> Pandurang S.chavan
First you need a connection so that you can read the data from SQL.
Next, in your view you must set SendUpdates = .T. (There is a checkbox inthe view designer at bottom left of the "Update Criteria" tab
Third your view MUST identify, in the update criteria the primary key for updates
Fourth, you must have at least one column flagged as updatable (again, the update criteria tab)
Fifth, set the WHERE clause options properly - if you are using surrogate primary keys (and why not?) then you should just use "Key Fields Only"
When all that is in place, TableUpdate() will work for a remote view.
Having said all that, this is NOT the best way to do this. You should either use a CursorAdapter, or SQL Passthrough, in preference to Remote Views. If you are not sure about CursorAdapters, see Bernard's excellent tutorials in the forum Articles section:
http://www.foxite.com/articles/read.aspx?id=49&document=creating-using-cursor-adapter-classes-a-simple-tutorialhttp://www.foxite.com/articles/read.aspx?id=53&document=creating-using-ca-classes-a-simple-tutorial-part-iihttp://www.foxite.com/articles/read.aspx?id=54&document=creating-using-ca-classes-a-simple-tutorial-part-iiaRegards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Tightline Computers Inc, Akron Ohio, USA