w_sys_begin_pulg.srw 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. $PBExportHeader$w_sys_begin_pulg.srw
  2. forward
  3. global type w_sys_begin_pulg from w_publ_base
  4. end type
  5. type p_1 from picture within w_sys_begin_pulg
  6. end type
  7. end forward
  8. global type w_sys_begin_pulg from w_publ_base
  9. integer x = 379
  10. integer y = 288
  11. integer width = 2295
  12. integer height = 1388
  13. boolean titlebar = false
  14. string title = ""
  15. boolean controlmenu = false
  16. boolean minbox = false
  17. windowtype windowtype = response!
  18. long backcolor = 16777215
  19. event connectdb pbm_custom01
  20. p_1 p_1
  21. end type
  22. global w_sys_begin_pulg w_sys_begin_pulg
  23. event connectdb;environment lenv_env // holds environment information
  24. //string ls_startupfile // holds name of start-up file
  25. // Get the environment information
  26. If ( GetEnvironment(lenv_env) <> 1 ) THEN
  27. MessageBox( "Application: Open", &
  28. "Unable to get environment information.~nHalting ..." )
  29. // HALT
  30. END IF
  31. // Select start-up file by operating system
  32. CHOOSE CASE lenv_env.OSType
  33. CASE windows!, windowsnt!
  34. // ls_startupfile = "car_wiz.ini"
  35. // if ( lenv_env.charset = charsetunicode! ) then
  36. // ls_startupfile = "pbu.ini"
  37. // end if
  38. CASE ELSE
  39. MessageBox( "Application: Open", &
  40. "Unrecognized operating system.~nHalting ..." )
  41. HALT
  42. END CHOOSE
  43. //Populate sqlca from current preference-file settings
  44. sys_ServerNameFJ = ProfileString (sys_inifilename, "fjdatabase", "servername", "")
  45. sys_DataBaseFJ = ProfileString (sys_inifilename, "fjdatabase", "database", "")
  46. sys_LoginIDFJ = ProfileString (sys_inifilename, "fjdatabase", "logid", "")
  47. sys_LoginPwdFJ = ProfileString (sys_inifilename, "fjdatabase", "LogPassWord", "")
  48. //MessageBox('', sys_ServerNameFJ + ';' + sys_DataBaseFJ + ';' + sys_LoginIDFJ + ';' + sys_LoginPwdFJ)
  49. sqlca.DBMS = ProfileString (sys_inifilename, "database", "dbms", "")
  50. sqlca.Database = ProfileString (sys_inifilename, "database", "database", "")
  51. sqlca.UserID = ProfileString (sys_inifilename, "database", "userid", "")
  52. sqlca.DBPass = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbpass", ""),1,sys_power_key)
  53. sqlca.LogID = ProfileString (sys_inifilename, "database", "logid", "")
  54. sqlca.LogPass = f_psw_bczh(ProfileString (sys_inifilename, "database", "LogPassWord", ""),1,sys_power_key)
  55. sqlca.ServerName = ProfileString (sys_inifilename, "database", "servername", "")
  56. SQLCA.Lock = "RC"
  57. SQLCA.AutoCommit = false
  58. sqlca.DBParm = "Database= '" + ProfileString (sys_inifilename, "database", "database", "") + "',PBTrimCharColumns='YES'"
  59. //MessageBox('', sqlca.ServerName + ';' + sqlca.database + ';' + sqlca.LogID + ';' + sqlca.logpass)
  60. //MessageBox("系统提示","1!")
  61. IF sqlca.Database = '' OR sqlca.ServerName = '' THEN
  62. MessageBox("系统提示","连接数据库失败!")
  63. OpenWithParm(w_set_sqlca_response,1) //0 只设连接信息 1 并允许自动新建数据库(启动首次调用)
  64. HALT
  65. END IF
  66. CONNECT USING sqlca;
  67. //MessageBox("系统提示","2!")
  68. IF sqlca.SQLCode < 0 THEN
  69. MessageBox("系统提示","连接数据库失败!")
  70. OpenWithParm(w_set_sqlca_response,1) //0 只设连接信息 1 并允许自动新建数据库(启动首次调用)
  71. HALT
  72. END IF
  73. EXECUTE IMMEDIATE "set transaction isolation level READ UNCOMMITTED";
  74. //execute immediate "set transaction isolation level REPEATABLE READ";
  75. //messagebox("",sqlca.sqlcode)
  76. IF sqlca.SQLCode <> 0 THEN
  77. MessageBox("系统提示","设置SQL服务器系统属性失败!"+sqlca.SQLErrText)
  78. HALT;
  79. END IF
  80. //MessageBox("系统提示","3!")
  81. Close(THIS)
  82. end event
  83. on w_sys_begin_pulg.create
  84. int iCurrent
  85. call super::create
  86. this.p_1=create p_1
  87. iCurrent=UpperBound(this.Control)
  88. this.Control[iCurrent+1]=this.p_1
  89. end on
  90. on w_sys_begin_pulg.destroy
  91. call super::destroy
  92. destroy(this.p_1)
  93. end on
  94. event timer;//CLOSE(THIS)
  95. end event
  96. event clicked;//close(this)
  97. end event
  98. event key;//CLOSE(THIS)
  99. end event
  100. event open;call super::open;this.title = '正在连接数据库......'
  101. //messagebox("","连接数据库")
  102. THIS.postevent('connectdb')
  103. end event
  104. event ue_before_open;p_1.PictureName=sys_flashbmpname //开始窗口的图片名称
  105. this.height=p_1.height
  106. this.width=p_1.width
  107. end event
  108. type cb_func from w_publ_base`cb_func within w_sys_begin_pulg
  109. boolean visible = false
  110. boolean enabled = false
  111. end type
  112. type cb_exit from w_publ_base`cb_exit within w_sys_begin_pulg
  113. boolean visible = false
  114. boolean enabled = false
  115. end type
  116. type p_1 from picture within w_sys_begin_pulg
  117. integer width = 2286
  118. integer height = 1304
  119. boolean bringtotop = true
  120. string pointer = "Select.cur"
  121. boolean originalsize = true
  122. string picturename = "flashwinpic.bmp"
  123. boolean focusrectangle = false
  124. end type
  125. event clicked;//close(parent)
  126. end event