【发布时间】:2011-06-23 17:47:03
【问题描述】:
我创建了一个非常简单的表单,其中包含两个文本框和一个“更新位置”按钮,其输入值应更新为数据库中的两个链接表。我最终试图把它放在一个独立的应用程序中,但现在我只想让表单本身工作。我对 FoxPro 很陌生,所以我不知道是否可以只使用一个表单来更新我的表格,或者是否还有其他问题。
这是我的“更新位置”按钮的代码(OldLoc 是第一个文本框,NewLoc 是第二个文本框):
SET DATABASE TO LOCATIONS
CLOSE ALL DATABASES
OPEN DATABASE locations\locations EXCLUSIVE
IF this.parent.OldLoc.Value == "" then
MESSAGEBOX('Please fill in the old location.', 48, 'Missing Location Information')
this.parent.OldLoc.SetFocus
ELSE
INDEX ON table1.loc TAG loc
SET ORDER TO loc
SEEK this.parent.OldLoc.Value IN table1
IF FOUND()
IF this.parent.NewLoc.Value == "" then
MESSAGEBOX('Please fill in the new location.', 48,
'Missing Location Information') this.parent.NewLoc.SetFocus
UPDATE table1 SET loc = this.parent.NewLoc.Value ;
WHERE loc = this.parent.OldLoc.value
UPDATE table2 SET loc = this.parent.NewLoc.Value ;
WHERE loc = this.parent.OldLoc.value
ENDIF
ENDIF
ENDIF
感谢您的任何意见!
【问题讨论】:
标签: database forms visual-foxpro