Visual FoxPro 6.0与大型数据库的无数据源连接(13)
时间:2025-07-12
时间:2025-07-12
*表单中加入页框控件,表格控件
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
上一篇:房地产开发流程、管理控制指导手册
下一篇:机械原理 齿轮机构及其设计