Visual FoxPro 6.0与大型数据库的无数据源连接(5)

2021-09-24 15:47

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

*增加

Varcode=THISFORM.Text1.value

Varname=THISFORM.Text1.value

=sqlsetprop(ConnHandle,'transactions',2) &&设置人工事务处理

=sqlprepare(ConnHandle,"INSERT INTO student(code,name,birthday,grade,class,tuition,maths,chinese,physics, chemistry,history,geobiology,biology,gym);

valueS('"+Varcode+"','"+Varname+"','"+Varbirthday+"',"+Vargrade+","+Varclass+",

"+Vartuition+","+Varmaths+","+Varchinese+","+Varphysics+","+Varchemistry+",

"+Varhistory+","+Vargeobiology+","+Varbiology+","+Vargym+")") =sqlexec(ConnHandle)

if messagebox("确定增加所输入数据信息吗?",4+32,"运行提示:")=6 =sqlcommit(ConnHandle)

else

=sqlrollback(ConnHandle)

THISFORM.text1.setfocus

endif


Visual FoxPro 6.0与大型数据库的无数据源连接(5).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:光河花园高层住宅楼消防验收申报表

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: