Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tableupdate() updates all recs in tbl instead of current
Message
From
13/11/2002 01:28:08
Vladimir Zhuravlev
Institute of the Physics of Earth,Russia
Moscow Region, Russia
 
 
To
12/11/2002 17:54:07
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00721886
Message ID:
00721986
Views:
10
>Help!
>ControlSource of my text fields in my form class is set to fields in my updatable cursor (.ControlSouce='cMyTable.myFieldName'). Whenever I make changes to a text field, & clicked on a command button that issues a TABLEUPDATE(0,.T.), it updates the original table with the new value for the related field, but it does so for all the records in the table (which I do not want) instead of the current record only (which is what I'd like it to do).
>
>I had it working properly at 1 time, but I had made changes since, including creating another updatable cursor (in myForm.LOAD). Can anybody give me a clue where the problem might be?
>
>myForm.Load()
>lcConnStr="DRIVER={Microsoft Visual FoxPro Driver};" + ;
>"SourceDB=c:\projects\myData.dbc;SourceType=DBC;UID=;PWD=;"
>
>lnHandle=SQLSTRINGCONNECT(lcConnStr)
>
>IF lnHandle>0
>lSuccessMyTable=SQLEXEC(lnHandle,"SELECT * FROM myTable","cMyTable")
>IF lSuccessMyTable=1
>SET MULTILOCKS ON
> CURSORSETPROP('Buffering',5,'cMyTable')
> CURSORSETPROP('TABLES','myTable','cMyTable')
> CURSORSETPROP('UPDATABLEFIELDLIST','refno,budgetcode','cMyTable')


Try buf=3
> CURSORSETPROP('KeyFieldList','refno','cMyTable')
> CURSORSETPROP('UpdateNameList','refno myTable.RefNo,budgetcode myTable.budgetcode','cMyTable')
> CURSORSETPROP('FetchMemo',.T.,'cMyTable')
> CURSORSETPROP('SendUpdates',.T.,'cMyTable')
>ENDIF
>ENDIF
>
>cmdSave.CLICK()
>TABLEUPDATE(0,.T.)
>
>**Let's say I changed budgetcode to 15 on record with refno=13.
>**The TABLEUPDATE changes all budgetcode to 15 for all records, not just for refno=13. The above code seems to be working just by itself; there must be a mistake I made somewhere else, but I'm clueless. Can anybody give me a clue?
>
>Thank you all!
MVP-2006-2011, PHD in Math and Physics ,
host of www.foxclub.ru,
VFP lector at Interface and Microinform companies
Head science researcher of VNIIA Rosatom.
Previous
Reply
Map
View

Click here to load this message in the networking platform