IF message.doubleparm<>1 Then Halt close
Select auto_len into :ll_version from sys_conf
where code="1020" using sqlca;
IF f_empty(ll_version) THEN
messagebox("提示","数据库版本信息1020丢失!请与西亚公司联系!",exclamation!)
Halt close
END IF
//在修改程序后,将 1020 的值改变后即可更新程序
IF ll_version>22 THEN
messagebox("提示","注意,程序需要更新!",exclamation!)
IF run("upload")<>1 THEN
messagebox("提示","更新文件失败,请重新安装完整的应用程序!",exclamation!)
END IF
halt close
END IF
SELECTBLOB up_file into :files from update_file
where id='0' using sqlca;
IF sqlca.sqlcode<>0 THEN
messagebox("提示","更新失败!",stopsign!)
halt
END IF
ls_return=app.file_blobtofile( files, app.app_path( ) + "prog.rar")
IF ls_return<>"" then
messagebox("提示","更新失败:" + ls_return,stopsign!)
halt
END IF
bol_load_over=true
run("rar e -o+ prog.rar")
//run("sb_super")
halt
下面上传原程序:
blob files
string ls_return
IF app.file_exists( sle_1.text)=False THEN
messagebox("提示","文件不存在!",stopsign!)
return
END IF
IF messagebox("询问","是否确定上传文件到数据服务器上,原数据服务器更新文件将被删除!",question!,yesno!)=2 then return
ls_return=app.file_filetoblob( sle_1.text, files)
if ls_return<>"" THEN
messagebox("提示",ls_return,stopsign!)
return
END IF
setpointer(hourglass!)
delete from update_file using sqlca;
commit using sqlca;
insert into update_file(id)values('0') using sqlca;
UPDATEBLOB update_file set up_file=:files using sqlca;
setpointer(arrow!)
IF sqlca.sqlcode<>0 THEN
rollback using sqlca;
app.error_proc( sqlca,"" /*string obj_string */)
return
END IF