*表单中加入页框控件,表格控件
THISFORM.Pageframe1.Page1.Grid1.RecordSource="mathscursor"
THISFORM.Pageframe1.Page1.Grid1.RecordSourceType=1 &&别名
THISFORM.Pageframe1.Page1.Grid1.Column1.ControlSource="mathscursor.code"
THISFORM.Pageframe1.Page1.Grid1.Column2.ControlSource=""
THISFORM.Pageframe1.Page1.Grid1.Column3.ControlSource="mathscursor.grade"
THISFORM.Pageframe1.Page1.Grid1.Column4.ControlSource="mathscursor.class"
THISFORM.Pageframe1.Page1.Grid1.Column5.ControlSource="mathscursor.maths"
*修改
=sqlsetprop(ConnHandle,'transactions',2) &&设置人工事务处理
=sqlprepare(ConnHandle, "update student set grade=grade+1") &&新年升级处理
=sqlexec(ConnHandle)
if messagebox("确定修改所输入数据信息吗?",4+32,"运行提示:")=6 =sqlcommit(ConnHandle)
else
=sqlrollback(ConnHandle)
THISFORM.text1.setfocus
endif
*删除
Vargrade=THISFORM.Text1.value
=sqlsetprop(ConnHandle,'transactions',2) &&设置人工事务处理
=sqlprepare(ConnHandle,"delete from student where grade='"+Vargrade+"'") =sqlexec(ConnHandle)
if messagebox("确定删除所输入数据信息吗?",4+32,"运行提示:")=6 =sqlcommit(ConnHandle)
else
=sqlrollback(ConnHandle)
THISFORM.text1.setfocus
endif
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库Visual FoxPro 6.0与大型数据库的无数据源连接(13)在线全文阅读。
相关推荐: