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

REPLACE ALL Qn.

Status
Not open for further replies.

Nouman

Programmer
Aug 16, 2001
2
CA
Hello World

This is my first post. Im a complete newbie in the foxpro world.
The project I am doing entails upsizing a standalone foxpro system to a client/server system with SQL2000 as the backend.

I am now working with remote views to update some tables.

The view is called Temphr

-All fields are updatable
-the type of update is Key fields only
-Send SQL Updates check box is checked
-Update Using: is set to SQL UPDATE

-the buffering mode is set to 3

All Im doing is running the following code

"USE temphr
REPLACE ALL temphr.some_numeric_field WITH 666"

The code runs without errors but the temphr table(on SQL server) remains
unaffected.


I just cannot figure out what is going on here.

And by the way ..

"USE temphr

UPDATE temphr SET some_numeric_field= 666"

this code works.

Any help would be appreciated
 
Have you looked at the help on REPLACE? There, if you're going to use 'ALL' it should be placed after the REPLACE field WITH newvalue. But assuming you've got it right in your code as opposed to your message, you might find it simplier to use SCAN... ENDSCAN. -- Dave Dardinger
 
Hi Nouman,
After setting buffering to 3, you must execute Tableupdate also like:
Select mYTable
*Your updatation code ...
IF ! TABLEUPDATE(.T.)
MESSAGEBOX("ERROR WHILE UPDATING")
ENDIF


Let me know if you still face problem.

And Dave, For replacing the field values
REPLACE ALL myfield=myValue is also perfect. Most of the commands in Visual Foxpro allow the movement of secondory options.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top