最难的语句
// Profile erp
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = False
SQLCA.DBParm = "ConnectString='DSN=erp'"
connect ;
if sqlca.sqlcode=0 then
open(w_main)
else
messagebox("提示","不能链接上数据库,请与系统开发人员联系。")
end if
//保存语句
if update(dw_1,true,false)=1 then
dw_1.resetupdate()
commit using sqlca;
if sqlca.sqlcode=0 then
messagebox("提示","资料保存成功!")
else
rollback using sqlca;
messagebox("错误!!!","保存失败")
end if
else
rollback using sqlca;
messagebox("错误!!!","保存失败")
end if
问题就是如果网络不好,程序经常出错退出!