$PBExportHeader$f_connetdb_nexe.srf global type f_connetdb_nexe from function_object end type forward prototypes global function integer f_connetdb_nexe () end prototypes global function integer f_connetdb_nexe ();//f_connetdb_nexe environment lenv_env // holds environment information //string ls_startupfile // holds name of start-up file // Get the environment information if ( GetEnvironment(lenv_env) <> 1 ) then MessageBox( "Application: Open", & "Unable to get environment information.~nHalting ..." ) halt end if // Select start-up file by operating system choose case lenv_env.ostype case windows!, windowsnt! // ls_startupfile = "car_wiz.ini" // if ( lenv_env.charset = charsetunicode! ) then // ls_startupfile = "pbu.ini" // end if case else MessageBox( "Application: Open", & "Unrecognized operating system.~nHalting ..." ) halt end choose //Populate sqlca from current preference-file settings sqlca.DBMS = ProfileString (sys_inifilename, "database", "dbms", "") sqlca.database = ProfileString (sys_inifilename, "database", "database", "") sqlca.userid = ProfileString (sys_inifilename, "database", "userid", "") sqlca.dbpass = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbpass", ""),1,sys_power_key) sqlca.logid = ProfileString (sys_inifilename, "database", "logid", "") sqlca.logpass = f_psw_bczh(ProfileString (sys_inifilename, "database", "LogPassWord", ""),1,sys_power_key) sqlca.servername = ProfileString (sys_inifilename, "database", "servername", "") sqlca.dbparm = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbparm", ""),1,sys_power_key) if sqlca.database='' or sqlca.servername='' then //Messagebox("系统提示","连接数据库失败!") //openWITHPARM(w_set_sqlca,1) //0 只设连接信息 1 并允许自动新建数据库(启动首次调用) //open(w_set_sqlca) halt end if connect using sqlca; If SQLCA.SQLCode<0 Then //Messagebox("系统提示","连接数据库失败!") //openWITHPARM(w_set_sqlca,1) //0 只设连接信息 1 并允许自动新建数据库(启动首次调用) halt End if String strkey strkey = 'I~'m LongJoe' EXECUTE Immediate :strkey USING sqlca; // 验证语句 execute immediate "set transaction isolation level READ UNCOMMITTED"; //messagebox("",sqlca.sqlcode) if sqlca.sqlcode<>0 then //messagebox("系统提示","设置SQL服务器系统属性失败!"+SQLCA.sqlerrtext) halt; end if //set transaction isolation level readcommitted; return 0 end function