发布时间:2019-07-31 23:23:39
driver_temp='SQL SERVER'server_temp='10.1.0.12'database_temp='biocclock'uid_temp='sa'pwd_temp='sa'connect_temp="driver="+driver_temp+";server="+server_temp+";uid="+uid_temp+";pwd="+pwd_temp+";database="+database_tempcon=SQLSTRINGCONNECT(connect_temp)IF con<=0MESSAGEBOX( "连接数据失败!请重新设置!",0+16,"提示信息")RETURNENDIF 数据查询TEXT TO cmd NOSHOWSELECT * FROM userENDTEXTif used('dsk')select dskuseendifN1=SQLEXEC(CON,cmd,"dsk")if n1<0messagebox('命令错误!!',0+48,'系统提示')returnendifselect dsk数据保存Transactions_error=.f.= SQLSETPROP(con, 'Transactions', 2) &&启动手动事务处理N1=SQLEXEC(CON,"UPDATE gly SET 密码=?txt2 WHERE 编号=?grbh")IF N1<=0Transactions_error=.t.ENDIFIF Transactions_error=.t.=SQLROLLBACK(con)=MESSAGEBOX("重要提示:密码修改失败,请重试!!!"+CHR(13)+CHR(13)+;CHR(13)+CHR(13),0+16,"错误提示信息")RETURNELSE=SQLCOMMIT(con)MESSAGEBOX("提示:密码修改成功!!!"+CHR(13)+CHR(13)+;CHR(13)+CHR(13),0+48,"提示信息",3)thisform.ReleaseENDIF= SQLSETPROP(con, 'Transactions', 1) &&恢复自动事务处理!