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

Update statment looks fine and it doesn't update?

Status
Not open for further replies.

shelbytll

Programmer
Dec 7, 2001
135
SG
When I perform an update sql statment like this:
Update tablename set field1=f1, field2=f2 where field1=oldf1 and field2=oldf2

It doesn't update.
I try to write out the sql statment and it looks fine.
What else do I need? I am a clever newbie...[peace]
 
Hi !!!
Use SQL string:
zm_sql='Update tablename set field1='+f1+', field2='
zm_sql=zm_sql+f2+' where field1='+oldf1+' and field2='
zm_sql=zm_sql+oldf2
Monika
Kind regards to you all from Warsaw !!!!!
 
and how do I execute that?
simply: execute zm_sql ? I am a clever newbie...[peace]
 
When i try to update, on the Status bar, it display "Record Locked". Is that the reason it was not updated? How to I resolve that? I am a clever newbie...[peace]
 
I tried to place unlock just above my UPDATE statment. However, it is still not updated. Why is it so? I am a clever newbie...[peace]
 
My little code which doing exactly:
aa = 'Woj. Skie'
zm = 'Update wojew set nazwa="'+aa+'" where woj = "20"'
&zm
use in wojew

Nobody can't open wojew exclusive
Monika Kind regards to you all from Warsaw !!!!!
 
Shelbytll

and how do I execute that?
simply: execute zm_sql ?


&zm_sql
Mike Gagnon
 
HI shelbytll,

1. I think you are keeping the project open and trying to execute the above command. Just close the project and then do the code in your command window.

2. If it is thru the progra.. code.. and in your network.. Obviously some locking has been done by somebody. If that is surely not the case.. some previous lock exists and I suggest just shut down the server and restart or get into the server and try to unlock and disassociate the user who is not just existing but shown as logged in.

Hope this helps you :) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
actually I am doing the project and try to run the FORM to see if it work. That mean the UPDATE cannot be perform when the project is open? I am a clever newbie...[peace]
 
hi,
I still can't get the UPdate done
Here is my statment:

zm = "Update info set brand='" + b + "',model='" + m + "',type1='" + t1 + "',type2='" + t2 + "' where brand='" + thisform.oldbrand + "' and model='" + thisform.oldmodel + "' and type1='" + thisform.oldcat1 + "' and type2='" + thisform.oldcat2 + "'"
&zm_sql


I try to write out the statment and it looks fine.
WHen I click on the button, the status bar shows Record: 88/89 Exclusive

And record number 88 is that particular record. I just don't understand why is it not updated. Is there a commit kind of transaction that I'm missing out? Please help... Thanks I am a clever newbie...[peace]
 
did u turn buffering on? if that is so u need to give
a tableupdate after the statement.

else try it out with a simple statement
 
No. How do I turn on that? Before the Update statment? I am a clever newbie...[peace]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top