w_set_sqlca_ecl.srw 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119
  1. $PBExportHeader$w_set_sqlca_ecl.srw
  2. $PBExportComments$数据库连接窗口
  3. forward
  4. global type w_set_sqlca_ecl from w_publ_base
  5. end type
  6. type cb_ok from uo_imflatbutton within w_set_sqlca_ecl
  7. end type
  8. type sle_logpass from singlelineedit within w_set_sqlca_ecl
  9. end type
  10. type sle_logid from singlelineedit within w_set_sqlca_ecl
  11. end type
  12. type sle_server from singlelineedit within w_set_sqlca_ecl
  13. end type
  14. type sle_database from singlelineedit within w_set_sqlca_ecl
  15. end type
  16. type sle_dbpass from singlelineedit within w_set_sqlca_ecl
  17. end type
  18. type sle_userid from singlelineedit within w_set_sqlca_ecl
  19. end type
  20. type sle_dbparm from singlelineedit within w_set_sqlca_ecl
  21. end type
  22. type st_9 from statictext within w_set_sqlca_ecl
  23. end type
  24. type st_6 from statictext within w_set_sqlca_ecl
  25. end type
  26. type st_5 from statictext within w_set_sqlca_ecl
  27. end type
  28. type st_4 from statictext within w_set_sqlca_ecl
  29. end type
  30. type st_3 from statictext within w_set_sqlca_ecl
  31. end type
  32. type st_2 from statictext within w_set_sqlca_ecl
  33. end type
  34. type st_00 from statictext within w_set_sqlca_ecl
  35. end type
  36. type st_7 from statictext within w_set_sqlca_ecl
  37. end type
  38. type sle_dbms from dropdownlistbox within w_set_sqlca_ecl
  39. end type
  40. type st_2334 from statictext within w_set_sqlca_ecl
  41. end type
  42. type st_345 from statictext within w_set_sqlca_ecl
  43. end type
  44. type sle_sqldb_mdf_sor from singlelineedit within w_set_sqlca_ecl
  45. end type
  46. type sle_sqldb_ldf_sor from singlelineedit within w_set_sqlca_ecl
  47. end type
  48. type st_jd from statictext within w_set_sqlca_ecl
  49. end type
  50. type st_1 from statictext within w_set_sqlca_ecl
  51. end type
  52. type sle_bookname from singlelineedit within w_set_sqlca_ecl
  53. end type
  54. type sle_fjname from singlelineedit within w_set_sqlca_ecl
  55. end type
  56. type cb_ch3 from commandbutton within w_set_sqlca_ecl
  57. end type
  58. type cb_1 from commandbutton within w_set_sqlca_ecl
  59. end type
  60. type st_11 from statictext within w_set_sqlca_ecl
  61. end type
  62. type ddlb_1 from dropdownlistbox within w_set_sqlca_ecl
  63. end type
  64. type st_12 from statictext within w_set_sqlca_ecl
  65. end type
  66. type rb_1 from radiobutton within w_set_sqlca_ecl
  67. end type
  68. type rb_2 from radiobutton within w_set_sqlca_ecl
  69. end type
  70. type sle_filename from singlelineedit within w_set_sqlca_ecl
  71. end type
  72. type cb_ch2 from commandbutton within w_set_sqlca_ecl
  73. end type
  74. type st_13 from statictext within w_set_sqlca_ecl
  75. end type
  76. type sle_folder from singlelineedit within w_set_sqlca_ecl
  77. end type
  78. type cb_2 from commandbutton within w_set_sqlca_ecl
  79. end type
  80. type cbx_modify from checkbox within w_set_sqlca_ecl
  81. end type
  82. type st_8 from statictext within w_set_sqlca_ecl
  83. end type
  84. type cbx_fj from checkbox within w_set_sqlca_ecl
  85. end type
  86. type st_10 from statictext within w_set_sqlca_ecl
  87. end type
  88. type cbx_yj from checkbox within w_set_sqlca_ecl
  89. end type
  90. type sle_yjname from singlelineedit within w_set_sqlca_ecl
  91. end type
  92. type cb_ch4 from commandbutton within w_set_sqlca_ecl
  93. end type
  94. type cb_connect from uo_imflatbutton within w_set_sqlca_ecl
  95. end type
  96. type gb_1 from groupbox within w_set_sqlca_ecl
  97. end type
  98. type gb_2 from groupbox within w_set_sqlca_ecl
  99. end type
  100. type gb_3 from groupbox within w_set_sqlca_ecl
  101. end type
  102. end forward
  103. global type w_set_sqlca_ecl from w_publ_base
  104. integer x = 283
  105. integer y = 12
  106. integer width = 2272
  107. integer height = 1632
  108. string title = "初始化帐套设定"
  109. boolean minbox = false
  110. windowtype windowtype = response!
  111. long backcolor = 16777215
  112. cb_ok cb_ok
  113. sle_logpass sle_logpass
  114. sle_logid sle_logid
  115. sle_server sle_server
  116. sle_database sle_database
  117. sle_dbpass sle_dbpass
  118. sle_userid sle_userid
  119. sle_dbparm sle_dbparm
  120. st_9 st_9
  121. st_6 st_6
  122. st_5 st_5
  123. st_4 st_4
  124. st_3 st_3
  125. st_2 st_2
  126. st_00 st_00
  127. st_7 st_7
  128. sle_dbms sle_dbms
  129. st_2334 st_2334
  130. st_345 st_345
  131. sle_sqldb_mdf_sor sle_sqldb_mdf_sor
  132. sle_sqldb_ldf_sor sle_sqldb_ldf_sor
  133. st_jd st_jd
  134. st_1 st_1
  135. sle_bookname sle_bookname
  136. sle_fjname sle_fjname
  137. cb_ch3 cb_ch3
  138. cb_1 cb_1
  139. st_11 st_11
  140. ddlb_1 ddlb_1
  141. st_12 st_12
  142. rb_1 rb_1
  143. rb_2 rb_2
  144. sle_filename sle_filename
  145. cb_ch2 cb_ch2
  146. st_13 st_13
  147. sle_folder sle_folder
  148. cb_2 cb_2
  149. cbx_modify cbx_modify
  150. st_8 st_8
  151. cbx_fj cbx_fj
  152. st_10 st_10
  153. cbx_yj cbx_yj
  154. sle_yjname sle_yjname
  155. cb_ch4 cb_ch4
  156. cb_connect cb_connect
  157. gb_1 gb_1
  158. gb_2 gb_2
  159. gb_3 gb_3
  160. end type
  161. global w_set_sqlca_ecl w_set_sqlca_ecl
  162. type prototypes
  163. Subroutine Sleep(ulong dwMilliseconds) LIBRARY "kernel32.dll"
  164. Function long ShellExecuteA (long hwnd, string lpOperation ,String lpFile, String lpParameters, String lpDirectory, Long nShowCmd) Library "shell32.dll" alias for "ShellExecuteA;Ansi"
  165. Function long GetFullPathName (String lpFileName ,Long nBufferLength,ref string lpBuffer,ref long lpFilePart) library "kernel32" ALIAS FOR "GetFullPathNameA;Ansi"
  166. end prototypes
  167. type variables
  168. INT ARROWADDNEW
  169. string ls_bat_filename='_ls_cmd_run.bat'
  170. string ls_txt_filename='_ls_cmd_rslt.txt'
  171. string masterpath
  172. string mssqlpath
  173. boolean lb_more = false
  174. string is_bookcode = '01'
  175. end variables
  176. forward prototypes
  177. public function integer wf_findisql ()
  178. public function integer wf_buildsqldb (ref string arg_msg)
  179. public subroutine wf_facechange ()
  180. public function integer wf_chk_database (string arg_databasename, transaction arg_transaction)
  181. public function integer wf_drop_database (string arg_databasename, transaction arg_transaction, boolean arg_ifcommit, ref string arg_msg)
  182. public function integer wf_create_database (string arg_folder, string arg_databasename, string arg_filename, string arg_sqldb_mdf_sor, string arg_sqldb_ldf_sor, transaction arg_transaction, boolean arg_ifcommit, ref string arg_msg)
  183. end prototypes
  184. public function integer wf_findisql ();//wf_findisql
  185. IF FileExists('c:\mssql7\data\master.mdf') THEN
  186. mssqlpath = 'c:\mssql7\data\'
  187. GOTO ext
  188. END IF
  189. IF FileExists('c:\Program Files\Microsoft SQL Server\80\data\master.mdf') THEN
  190. mssqlpath = 'c:\Program Files\Microsoft SQL Server\data\'
  191. GOTO ext
  192. END IF
  193. IF FileExists('c:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') THEN
  194. mssqlpath = "c:\Program Files\Microsoft SQL Server\MSSQL\data\"
  195. GOTO ext
  196. END IF
  197. IF FileExists('d:\mssql7\data\master.mdf') THEN
  198. mssqlpath = 'd:\mssql7\data\'
  199. GOTO ext
  200. END IF
  201. IF FileExists('d:\Program Files\Microsoft SQL Server\80\data\master.mdf') THEN
  202. mssqlpath = 'd:\Program Files\Microsoft SQL Server\data\'
  203. GOTO ext
  204. END IF
  205. IF FileExists('d:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') THEN
  206. mssqlpath = 'd:\Program Files\Microsoft SQL Server\MSSQL\data\'
  207. GOTO ext
  208. END IF
  209. IF FileExists('e:\mssql7\data\master.mdf') THEN
  210. mssqlpath = 'e:\mssql7\data\'
  211. GOTO ext
  212. END IF
  213. IF FileExists('e:\Program Files\Microsoft SQL Server\80\data\master.mdf') THEN
  214. mssqlpath = 'e:\Program Files\Microsoft SQL Server\data\'
  215. GOTO ext
  216. END IF
  217. IF FileExists('e:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') THEN
  218. mssqlpath = 'e:\Program Files\Microsoft SQL Server\MSSQL\data\'
  219. GOTO ext
  220. END IF
  221. IF FileExists('f:\mssql7\data\master.mdf') THEN
  222. mssqlpath = 'f:\mssql7\data\'
  223. GOTO ext
  224. END IF
  225. IF FileExists('f:\Program Files\Microsoft SQL Server\80\data\master.mdf') THEN
  226. mssqlpath = 'f:\Program Files\Microsoft SQL Server\data\'
  227. GOTO ext
  228. END IF
  229. IF FileExists('f:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') THEN
  230. mssqlpath = 'f:\Program Files\Microsoft SQL Server\MSSQL\data\'
  231. GOTO ext
  232. END IF
  233. IF FileExists('g:\mssql7\data\master.mdf') THEN
  234. mssqlpath = 'g:\mssql7\data\'
  235. GOTO ext
  236. END IF
  237. IF FileExists('g:\Program Files\Microsoft SQL Server\80\data\master.mdf') THEN
  238. mssqlpath = 'g:\Program Files\Microsoft SQL Server\data\'
  239. GOTO ext
  240. END IF
  241. IF FileExists('g:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') THEN
  242. mssqlpath = 'g:\Program Files\Microsoft SQL Server\MSSQL\data\'
  243. GOTO ext
  244. END IF
  245. IF FileExists('h:\mssql7\data\master.mdf') THEN
  246. mssqlpath = 'h:\mssql7\data\'
  247. GOTO ext
  248. END IF
  249. IF FileExists('h:\Program Files\Microsoft SQL Server\80\data\master.mdf') THEN
  250. mssqlpath = 'h:\Program Files\Microsoft SQL Server\data\'
  251. GOTO ext
  252. END IF
  253. IF FileExists('h:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') THEN
  254. mssqlpath = 'h:\Program Files\Microsoft SQL Server\MSSQL\data\'
  255. GOTO ext
  256. END IF
  257. IF FileExists('d:\Program Files\MSDE\MSSQL\data\master.mdf') THEN
  258. mssqlpath = 'd:\Program Files\MSDE\MSSQL\data\'
  259. GOTO ext
  260. END IF
  261. ext:
  262. IF mssqlpath = '' THEN mssqlpath = "c:\Program Files\Microsoft SQL Server\MSSQL\data\"
  263. RETURN 0
  264. end function
  265. public function integer wf_buildsqldb (ref string arg_msg);//wf_buildsqldb
  266. Integer li_FileNum,rslt = 1
  267. String comm,msg
  268. Long i,j,lu_return
  269. String ls_test
  270. String ls_dat
  271. String ls_databasename
  272. String ls_filename
  273. Transaction db_Transaction
  274. db_Transaction = Create Transaction
  275. Open(w_sys_wait)
  276. IF Trim(sle_folder.Text) = '' THEN
  277. arg_msg = '请输入目标文件路径!'
  278. rslt = 0
  279. GOTO ext
  280. END IF
  281. Int ll_result
  282. ll_result = createdirectory(sle_folder.Text)
  283. //IF ll_result = -1 THEN
  284. // arg_msg = '目标文件路径创建失败!'
  285. // rslt = 0
  286. // GOTO ext
  287. //END IF
  288. ls_dat = sle_filename.Text
  289. IF Not FileExists ( ls_dat ) THEN
  290. arg_msg = "主数据库文件不存在!"
  291. rslt = 0
  292. GOTO ext
  293. END IF
  294. IF rb_1.Checked THEN
  295. ls_dat = Trim(sle_fjname.Text)
  296. IF Not FileExists ( ls_dat ) THEN
  297. arg_msg = "附件数据库文件不存在!"
  298. rslt = 0
  299. GOTO ext
  300. END IF
  301. END IF
  302. IF cbx_yj.Checked THEN
  303. ls_dat = Trim(sle_yjname.Text)
  304. IF Not FileExists ( ls_dat ) THEN
  305. arg_msg = "邮件数据库文件不存在!"
  306. rslt = 0
  307. GOTO ext
  308. END IF
  309. END IF
  310. w_sys_wait.wf_set_msg("正在尝试新建数据库,此过程预计需要用时1分钟...")
  311. db_Transaction.DBMS = "SNC SQL Native Client(OLE DB)"
  312. db_Transaction.Database = 'master'
  313. db_Transaction.UserID = ProfileString (sys_inifilename, "database", "userid", "")
  314. db_Transaction.DBPass = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbpass", ""),1,sys_power_key)
  315. db_Transaction.LogID = sle_logid.Text
  316. db_Transaction.LogPass = sle_logpass.Text
  317. db_Transaction.ServerName = sle_server.Text
  318. db_Transaction.Lock = "RU"
  319. db_Transaction.AutoCommit = False
  320. db_Transaction.DBParm = "Database= 'master' ,PBTrimCharColumns='YES'"
  321. IF db_Transaction.Database = '' Or db_Transaction.ServerName = '' THEN
  322. arg_msg = "连接数据库失败!"
  323. rslt = 0
  324. GOTO ext
  325. END IF
  326. CONNECT Using db_Transaction;
  327. db_Transaction.AutoCommit = True
  328. IF db_Transaction.SQLCode <> 0 THEN
  329. DISCONNECT Using db_Transaction;
  330. arg_msg = '服务器连接失败!!'
  331. rslt = 0
  332. GOTO ext
  333. END IF
  334. //检查主数据库
  335. ls_databasename = Trim(sle_database.Text)
  336. IF wf_chk_database(ls_databasename, db_Transaction) = 1 THEN
  337. IF MessageBox ("询问","主数据库已存在,是否确定要覆盖?",Question!,YesNo! ) = 2 THEN
  338. rslt = 2
  339. GOTO ext
  340. ELSE
  341. IF wf_drop_database(ls_databasename, db_Transaction, False, arg_msg) = 0 THEN
  342. rslt = 0
  343. GOTO ext
  344. END IF
  345. END IF
  346. END IF
  347. //检查附件数据库
  348. ls_databasename = Trim(sle_database.Text)+ '_fj'
  349. IF wf_chk_database(ls_databasename, db_Transaction) = 1 THEN
  350. IF MessageBox ("询问","附件数据库已存在,是否确定要覆盖?",Question!,YesNo! ) = 2 THEN
  351. rslt = 2
  352. GOTO ext
  353. ELSE
  354. IF wf_drop_database(ls_databasename, db_Transaction, False, arg_msg) = 0 THEN
  355. rslt = 0
  356. GOTO ext
  357. END IF
  358. END IF
  359. END IF
  360. //检查邮件数据库
  361. ls_databasename = Trim(sle_database.Text) + '_yj'
  362. IF wf_chk_database(ls_databasename, db_Transaction) = 1 THEN
  363. IF MessageBox ("询问","邮件数据库已存在,是否确定要覆盖?",Question!,YesNo! ) = 2 THEN
  364. rslt = 2
  365. GOTO ext
  366. ELSE
  367. IF wf_drop_database(ls_databasename, db_Transaction, False, arg_msg) = 0 THEN
  368. rslt = 0
  369. GOTO ext
  370. END IF
  371. END IF
  372. END IF
  373. //新建主数据库
  374. ls_databasename = Trim(sle_database.Text)
  375. ls_filename = Trim(sle_filename.Text)
  376. st_jd.Text = '正在新建主数据库'
  377. IF wf_create_database(sle_folder.Text, ls_databasename, ls_filename, sle_sqldb_mdf_sor.Text, sle_sqldb_ldf_sor.Text, db_Transaction, false, arg_msg) = 0 THEN
  378. rslt = 0
  379. GOTO ext
  380. END IF
  381. //新建附件数据库
  382. IF cbx_fj.Checked THEN
  383. ls_databasename = Trim(sle_database.Text)+ '_fj'
  384. ls_filename = Trim(sle_fjname.Text)
  385. st_jd.Text = '正在新建附件数据库'
  386. IF wf_create_database(sle_folder.Text, ls_databasename, ls_filename, 'filemanage_Data', 'filemanage_Log', db_Transaction, false, arg_msg) = 0 THEN
  387. rslt = 0
  388. GOTO ext
  389. END IF
  390. String ls_MDF,ls_ldf
  391. ls_MDF = ls_databasename + ".MDF"
  392. ls_ldf = ls_databasename + ".ldf"
  393. comm = "INSERT INTO " + Trim(sle_database.Text) + ".dbo.U_OuterConnection ("+&
  394. "ConnectionID ,"+&
  395. "DBMS ,"+&
  396. "ConnectionName ,"+&
  397. "ConnectionType ,"+&
  398. "DataBaseName ,"+&
  399. "ServerName ,"+&
  400. "LogId ,"+&
  401. "LogPass ,"+&
  402. "mdf_name ,"+&
  403. "ldf_name ,"+&
  404. "opdate"+&
  405. ")"+&
  406. "VALUES"+&
  407. "("+&
  408. "11,"+&
  409. "'MSS Microsoft SQL Server 6.x',"+&
  410. "'附件数据库',"+&
  411. "0,"+&
  412. "'" + ls_databasename + "',"+&
  413. "'" + db_Transaction.ServerName+"',"+&
  414. "'" + db_Transaction.LogID + "',"+&
  415. "'" + db_Transaction.LogPass + "',"+&
  416. "'" + ls_MDF + "',"+&
  417. "'" + ls_ldf + "',"+&
  418. "getdate()"+&
  419. ");"
  420. EXECUTE Immediate :comm Using db_Transaction;
  421. IF db_Transaction.SQLCode <> 0 THEN
  422. rslt = 0
  423. arg_msg = '设置附件数据库连接失败,请手动设置'
  424. GOTO ext
  425. END IF
  426. END IF
  427. //新建邮件数据库
  428. IF cbx_yj.Checked THEN
  429. ls_databasename = Trim(sle_database.Text) + '_yj'
  430. ls_filename = Trim(sle_yjname.Text)
  431. st_jd.Text = '正在新建邮件数据库'
  432. IF wf_create_database(sle_folder.Text, ls_databasename, ls_filename, 'filemanage_Data', 'filemanage_Log', db_Transaction, false, arg_msg) = 0 THEN
  433. rslt = 0
  434. GOTO ext
  435. END IF
  436. ls_MDF = ls_databasename + ".MDF"
  437. ls_ldf = ls_databasename + ".ldf"
  438. comm = "INSERT INTO " + Trim(sle_database.Text) + ".dbo.U_OuterConnection ("+&
  439. "ConnectionID ,"+&
  440. "DBMS ,"+&
  441. "ConnectionName ,"+&
  442. "ConnectionType ,"+&
  443. "DataBaseName ,"+&
  444. "ServerName ,"+&
  445. "LogId ,"+&
  446. "LogPass ,"+&
  447. "mdf_name ,"+&
  448. "ldf_name ,"+&
  449. "opdate"+&
  450. ")"+&
  451. "VALUES"+&
  452. "("+&
  453. "12,"+&
  454. "'MSS Microsoft SQL Server 6.x',"+&
  455. "'邮件数据库',"+&
  456. "2,"+&
  457. "'" + ls_databasename + "',"+&
  458. "'" + db_Transaction.ServerName+"',"+&
  459. "'" + db_Transaction.LogID + "',"+&
  460. "'" + db_Transaction.LogPass + "',"+&
  461. "'" + ls_MDF + "',"+&
  462. "'" + ls_ldf + "',"+&
  463. "getdate()"+&
  464. ");"
  465. EXECUTE Immediate :comm Using db_Transaction;
  466. IF db_Transaction.SQLCode <> 0 THEN
  467. rslt = 0
  468. arg_msg = '设置邮件数据库连接失败,请手动设置'
  469. GOTO ext
  470. END IF
  471. END IF
  472. ext:
  473. w_sys_wait.Hide()
  474. Close(w_sys_wait)
  475. IF rslt = 1 THEN
  476. COMMIT Using db_Transaction;
  477. ELSE
  478. ROLLBACK Using db_Transaction;
  479. END IF
  480. DISCONNECT Using db_Transaction;
  481. Destroy db_Transaction
  482. RETURN rslt
  483. end function
  484. public subroutine wf_facechange ();//IF rb_2.Checked THEN
  485. // ddlb_1.Enabled = False
  486. // cbx_modify.Enabled = False
  487. // sle_filename.Enabled = False
  488. // cb_ch2.Enabled = False
  489. // sle_fjname.Enabled = False
  490. // cb_ch3.Enabled = False
  491. // sle_folder.Enabled = False
  492. // cb_2.Enabled = False
  493. // cbx_fj.Enabled = False
  494. // st_1.Enabled = False
  495. // st_12.Enabled = False
  496. // st_8.Enabled = False
  497. // st_13.Enabled = False
  498. // cbx_yj.Enabled = False
  499. // sle_yjname.Enabled = False
  500. // cb_ch4.Enabled = False
  501. //
  502. // This.Height = 780
  503. // cb_1.Text = '︾'
  504. //
  505. // gb_1.Visible = False
  506. // st_7.Visible = False
  507. // sle_server.Visible = False
  508. // st_5.Visible = False
  509. // sle_logid.Visible = False
  510. // st_6.Visible = False
  511. // sle_logpass.Visible = False
  512. //
  513. // cb_ok.Y = 532
  514. // cb_exit.Y = 532
  515. //ELSE
  516. //
  517. //END IF
  518. IF rb_2.Checked THEN
  519. ddlb_1.Enabled = False
  520. cbx_modify.Enabled = False
  521. sle_filename.Enabled = False
  522. cb_ch2.Enabled = False
  523. sle_fjname.Enabled = False
  524. cb_ch3.Enabled = False
  525. sle_folder.Enabled = False
  526. cb_2.Enabled = False
  527. cbx_fj.Enabled = False
  528. st_1.Enabled = False
  529. st_12.Enabled = False
  530. st_8.Enabled = False
  531. st_13.Enabled = False
  532. cbx_yj.Enabled = False
  533. sle_yjname.Enabled = False
  534. cb_ch4.Enabled = False
  535. ELSE
  536. ddlb_1.Enabled = True
  537. cbx_modify.Enabled = True
  538. END IF
  539. IF cb_1.Text = '︽' THEN
  540. This.Height = 1700 //PARENT.Height + 1000
  541. //cb_1.Text = '︽'
  542. gb_1.Visible = True
  543. st_7.Visible = True
  544. sle_server.Visible = True
  545. st_5.Visible = True
  546. sle_logid.Visible = True
  547. st_6.Visible = True
  548. sle_logpass.Visible = True
  549. cb_ok.Y = 1436
  550. cb_exit.Y = 1436
  551. cb_connect.Y = 1436
  552. ELSE
  553. This.Height = 780 //PARENT.Height - 1000
  554. //cb_1.Text = '︾'
  555. gb_1.Visible = False
  556. st_7.Visible = False
  557. sle_server.Visible = False
  558. st_5.Visible = False
  559. sle_logid.Visible = False
  560. st_6.Visible = False
  561. sle_logpass.Visible = False
  562. cb_ok.Y = 532
  563. cb_exit.Y = 532
  564. cb_connect.Y = 532
  565. END IF
  566. end subroutine
  567. public function integer wf_chk_database (string arg_databasename, transaction arg_transaction);String ls_test
  568. ls_test = "if exists(select 1 from master..sysdatabases where name='" + arg_databasename + "') raiserror('Database existed',18,1) else raiserror('Database not existed',18,1) "
  569. EXECUTE Immediate :ls_test Using arg_transaction;
  570. IF pos(arg_transaction.SQLErrText , 'Database existed' ) > 0 THEN
  571. RETURN 1
  572. ELSE
  573. RETURN 0
  574. END IF
  575. end function
  576. public function integer wf_drop_database (string arg_databasename, transaction arg_transaction, boolean arg_ifcommit, ref string arg_msg);Integer rslt = 1
  577. String comm
  578. comm = " IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'" + arg_databasename + "') DROP DATABASE [" + arg_databasename + "]"
  579. EXECUTE Immediate :comm Using arg_Transaction;
  580. IF arg_Transaction.SQLCode <> 0 THEN
  581. arg_msg = '删除数据库失败,请手动删除['+arg_databasename+']>'+arg_Transaction.SQLErrText
  582. rslt = 0
  583. ELSE
  584. rslt = 1
  585. END IF
  586. IF rslt = 0 THEN
  587. ROLLBACK Using arg_Transaction;
  588. ELSEIF arg_ifcommit THEN
  589. COMMIT Using arg_Transaction;
  590. END IF
  591. RETURN rslt
  592. end function
  593. public function integer wf_create_database (string arg_folder, string arg_databasename, string arg_filename, string arg_sqldb_mdf_sor, string arg_sqldb_ldf_sor, transaction arg_transaction, boolean arg_ifcommit, ref string arg_msg);Integer rslt = 1
  594. String comm
  595. comm = ' create DATABASE '+arg_databasename+&
  596. " on(name='"+arg_sqldb_mdf_sor+"',FILENAME= '"+arg_folder + '\' + arg_databasename+'_data.ldf'+"') log on (name='"+arg_sqldb_ldf_sor+"',FILENAME= '"+arg_folder + '\' + arg_databasename+'_log.ldf'+"')"
  597. EXECUTE Immediate :comm Using arg_transaction;
  598. IF arg_transaction.SQLCode <> 0 THEN
  599. arg_msg = '建立数据库['+arg_databasename+']失败,请手动建立及恢复>'+arg_transaction.SQLErrText
  600. rslt = 0
  601. GOTO ext
  602. END IF
  603. // st_jd.Text = '正在恢复主数据库...'
  604. comm = 'RESTORE DATABASE '+arg_databasename+" from DISK= '"+arg_filename+"'"+&
  605. " WITH MOVE '"+arg_sqldb_mdf_sor+"' TO '"+arg_folder + '\' + arg_databasename+'_data.ldf'+"',"+&
  606. " MOVE '"+arg_sqldb_ldf_sor+"' TO '"+arg_folder + '\' + arg_databasename+'_log.ldf'+"',"+'REPLACE'
  607. EXECUTE Immediate :comm Using arg_transaction;
  608. IF arg_transaction.SQLCode <> 0 THEN
  609. arg_msg = '恢复数据库['+arg_databasename+']失败,请手动恢复>'+arg_transaction.SQLErrText
  610. rslt = 0
  611. END IF
  612. ext:
  613. IF rslt = 0 THEN
  614. ROLLBACK Using arg_transaction;
  615. ELSEIF arg_ifcommit THEN
  616. COMMIT Using arg_transaction;
  617. END IF
  618. RETURN rslt
  619. end function
  620. event open;call super::open;// Open script for W_SET_SQLCA
  621. //ARROWADDNEW = Message.DoubleParm
  622. is_bookcode = Message.StringParm
  623. IF IsNull(is_bookcode) THEN is_bookcode = '01'
  624. IF is_bookcode = '' THEN is_bookcode = '01'
  625. IF sys_cur_path = "" THEN
  626. Long rslt = 1
  627. String lpBuffer
  628. lpBuffer = Fill('',200)
  629. Long lpfilepart,li_FileNum
  630. rslt = GetFullPathName(sys_inifilename,196,lpBuffer,lpfilepart)
  631. sys_cur_path = Left(lpBuffer,Len(lpBuffer)-Len(sys_inifilename))
  632. END IF
  633. sle_dbms.Text = ProfileString (sys_inifilename, "database", "dbms", "")
  634. sle_database.Text = ProfileString (sys_inifilename, "database", "database", "")
  635. sle_userid.Text = ProfileString (sys_inifilename, "database", "userid", "")
  636. sle_dbpass.Text = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbpass", ""),1,sys_power_key)
  637. sle_logid.Text = ProfileString (sys_inifilename, "database", "logid", "SA")
  638. sle_logpass.Text = f_psw_bczh(ProfileString (sys_inifilename, "database", "LogPassWord", ""),1,sys_power_key)
  639. sle_server.Text = ProfileString (sys_inifilename, "database", "servername", "")
  640. sle_dbparm.Text = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbparm", ""),1,sys_power_key)
  641. sle_bookname.Text = ProfileString (sys_inifilename, "database", "bookname", "")
  642. sle_sqldb_mdf_sor.Text = ProfileString (sys_inifilename, "database", "sqldb_mdf_sor", '')
  643. sle_sqldb_ldf_sor.Text = ProfileString (sys_inifilename, "database", "sqldb_ldf_sor",'' )
  644. String ls_fjname, ls_yjname
  645. ls_fjname = ProfileString (sys_inifilename, "database", "defaultfjdb",'' )
  646. ls_yjname = ProfileString (sys_inifilename, "database", "defaultyjdb",'' )
  647. IF ls_fjname = "" THEN
  648. ls_fjname = "企精灵附件数据库"
  649. END IF
  650. IF ls_yjname = "" THEN
  651. ls_yjname = "企精灵邮件数据库"
  652. END IF
  653. sle_fjname.Text = sys_cur_path + ls_fjname +'.dat'
  654. sle_yjname.Text = sys_cur_path + ls_yjname +'.dat'
  655. Long i
  656. String ls_temp
  657. FOR i = 1 To 3
  658. ls_temp = ProfileString (sys_inifilename, "database", "demodb" + String(i), '')
  659. IF ls_temp <> '' THEN
  660. ddlb_1.AddItem (ls_temp)
  661. END IF
  662. IF i = 1 THEN
  663. ddlb_1.Text = ls_temp
  664. sle_filename.Text = sys_cur_path + ddlb_1.Text + '.dat'
  665. END IF
  666. NEXT
  667. wf_findisql()
  668. masterpath = sys_cur_path + 'database'
  669. sle_folder.Text = masterpath
  670. IF sle_server.Text = "" THEN
  671. sle_server.Text = "."
  672. // cb_1.Text = '︽'
  673. //ELSE
  674. // This.Height = 780
  675. // gb_1.Visible = False
  676. // st_7.Visible = False
  677. // sle_server.Visible = False
  678. // st_5.Visible = False
  679. // sle_logid.Visible = False
  680. // st_6.Visible = False
  681. // sle_logpass.Visible = False
  682. END IF
  683. IF sle_database.Text = "" THEN
  684. sle_database.Text = "EW5_DB"
  685. END IF
  686. IF sle_logid.Text = "" THEN
  687. sle_logid.Text = "sa"
  688. END IF
  689. cb_1.Text = '︾'
  690. wf_facechange()
  691. end event
  692. on w_set_sqlca_ecl.create
  693. int iCurrent
  694. call super::create
  695. this.cb_ok=create cb_ok
  696. this.sle_logpass=create sle_logpass
  697. this.sle_logid=create sle_logid
  698. this.sle_server=create sle_server
  699. this.sle_database=create sle_database
  700. this.sle_dbpass=create sle_dbpass
  701. this.sle_userid=create sle_userid
  702. this.sle_dbparm=create sle_dbparm
  703. this.st_9=create st_9
  704. this.st_6=create st_6
  705. this.st_5=create st_5
  706. this.st_4=create st_4
  707. this.st_3=create st_3
  708. this.st_2=create st_2
  709. this.st_00=create st_00
  710. this.st_7=create st_7
  711. this.sle_dbms=create sle_dbms
  712. this.st_2334=create st_2334
  713. this.st_345=create st_345
  714. this.sle_sqldb_mdf_sor=create sle_sqldb_mdf_sor
  715. this.sle_sqldb_ldf_sor=create sle_sqldb_ldf_sor
  716. this.st_jd=create st_jd
  717. this.st_1=create st_1
  718. this.sle_bookname=create sle_bookname
  719. this.sle_fjname=create sle_fjname
  720. this.cb_ch3=create cb_ch3
  721. this.cb_1=create cb_1
  722. this.st_11=create st_11
  723. this.ddlb_1=create ddlb_1
  724. this.st_12=create st_12
  725. this.rb_1=create rb_1
  726. this.rb_2=create rb_2
  727. this.sle_filename=create sle_filename
  728. this.cb_ch2=create cb_ch2
  729. this.st_13=create st_13
  730. this.sle_folder=create sle_folder
  731. this.cb_2=create cb_2
  732. this.cbx_modify=create cbx_modify
  733. this.st_8=create st_8
  734. this.cbx_fj=create cbx_fj
  735. this.st_10=create st_10
  736. this.cbx_yj=create cbx_yj
  737. this.sle_yjname=create sle_yjname
  738. this.cb_ch4=create cb_ch4
  739. this.cb_connect=create cb_connect
  740. this.gb_1=create gb_1
  741. this.gb_2=create gb_2
  742. this.gb_3=create gb_3
  743. iCurrent=UpperBound(this.Control)
  744. this.Control[iCurrent+1]=this.cb_ok
  745. this.Control[iCurrent+2]=this.sle_logpass
  746. this.Control[iCurrent+3]=this.sle_logid
  747. this.Control[iCurrent+4]=this.sle_server
  748. this.Control[iCurrent+5]=this.sle_database
  749. this.Control[iCurrent+6]=this.sle_dbpass
  750. this.Control[iCurrent+7]=this.sle_userid
  751. this.Control[iCurrent+8]=this.sle_dbparm
  752. this.Control[iCurrent+9]=this.st_9
  753. this.Control[iCurrent+10]=this.st_6
  754. this.Control[iCurrent+11]=this.st_5
  755. this.Control[iCurrent+12]=this.st_4
  756. this.Control[iCurrent+13]=this.st_3
  757. this.Control[iCurrent+14]=this.st_2
  758. this.Control[iCurrent+15]=this.st_00
  759. this.Control[iCurrent+16]=this.st_7
  760. this.Control[iCurrent+17]=this.sle_dbms
  761. this.Control[iCurrent+18]=this.st_2334
  762. this.Control[iCurrent+19]=this.st_345
  763. this.Control[iCurrent+20]=this.sle_sqldb_mdf_sor
  764. this.Control[iCurrent+21]=this.sle_sqldb_ldf_sor
  765. this.Control[iCurrent+22]=this.st_jd
  766. this.Control[iCurrent+23]=this.st_1
  767. this.Control[iCurrent+24]=this.sle_bookname
  768. this.Control[iCurrent+25]=this.sle_fjname
  769. this.Control[iCurrent+26]=this.cb_ch3
  770. this.Control[iCurrent+27]=this.cb_1
  771. this.Control[iCurrent+28]=this.st_11
  772. this.Control[iCurrent+29]=this.ddlb_1
  773. this.Control[iCurrent+30]=this.st_12
  774. this.Control[iCurrent+31]=this.rb_1
  775. this.Control[iCurrent+32]=this.rb_2
  776. this.Control[iCurrent+33]=this.sle_filename
  777. this.Control[iCurrent+34]=this.cb_ch2
  778. this.Control[iCurrent+35]=this.st_13
  779. this.Control[iCurrent+36]=this.sle_folder
  780. this.Control[iCurrent+37]=this.cb_2
  781. this.Control[iCurrent+38]=this.cbx_modify
  782. this.Control[iCurrent+39]=this.st_8
  783. this.Control[iCurrent+40]=this.cbx_fj
  784. this.Control[iCurrent+41]=this.st_10
  785. this.Control[iCurrent+42]=this.cbx_yj
  786. this.Control[iCurrent+43]=this.sle_yjname
  787. this.Control[iCurrent+44]=this.cb_ch4
  788. this.Control[iCurrent+45]=this.cb_connect
  789. this.Control[iCurrent+46]=this.gb_1
  790. this.Control[iCurrent+47]=this.gb_2
  791. this.Control[iCurrent+48]=this.gb_3
  792. end on
  793. on w_set_sqlca_ecl.destroy
  794. call super::destroy
  795. destroy(this.cb_ok)
  796. destroy(this.sle_logpass)
  797. destroy(this.sle_logid)
  798. destroy(this.sle_server)
  799. destroy(this.sle_database)
  800. destroy(this.sle_dbpass)
  801. destroy(this.sle_userid)
  802. destroy(this.sle_dbparm)
  803. destroy(this.st_9)
  804. destroy(this.st_6)
  805. destroy(this.st_5)
  806. destroy(this.st_4)
  807. destroy(this.st_3)
  808. destroy(this.st_2)
  809. destroy(this.st_00)
  810. destroy(this.st_7)
  811. destroy(this.sle_dbms)
  812. destroy(this.st_2334)
  813. destroy(this.st_345)
  814. destroy(this.sle_sqldb_mdf_sor)
  815. destroy(this.sle_sqldb_ldf_sor)
  816. destroy(this.st_jd)
  817. destroy(this.st_1)
  818. destroy(this.sle_bookname)
  819. destroy(this.sle_fjname)
  820. destroy(this.cb_ch3)
  821. destroy(this.cb_1)
  822. destroy(this.st_11)
  823. destroy(this.ddlb_1)
  824. destroy(this.st_12)
  825. destroy(this.rb_1)
  826. destroy(this.rb_2)
  827. destroy(this.sle_filename)
  828. destroy(this.cb_ch2)
  829. destroy(this.st_13)
  830. destroy(this.sle_folder)
  831. destroy(this.cb_2)
  832. destroy(this.cbx_modify)
  833. destroy(this.st_8)
  834. destroy(this.cbx_fj)
  835. destroy(this.st_10)
  836. destroy(this.cbx_yj)
  837. destroy(this.sle_yjname)
  838. destroy(this.cb_ch4)
  839. destroy(this.cb_connect)
  840. destroy(this.gb_1)
  841. destroy(this.gb_2)
  842. destroy(this.gb_3)
  843. end on
  844. event close;call super::close;IF IsValid(w_sys_login_s) THEN
  845. w_sys_login_s.Dynamic wf_getbook(True)
  846. END IF
  847. end event
  848. type cb_func from w_publ_base`cb_func within w_set_sqlca_ecl
  849. boolean visible = false
  850. integer x = 1934
  851. integer y = 644
  852. integer taborder = 70
  853. boolean enabled = false
  854. end type
  855. type cb_exit from w_publ_base`cb_exit within w_set_sqlca_ecl
  856. integer x = 1513
  857. integer y = 532
  858. integer width = 315
  859. integer taborder = 110
  860. string text = "取消"
  861. end type
  862. type cb_ok from uo_imflatbutton within w_set_sqlca_ecl
  863. integer x = 965
  864. integer y = 532
  865. integer width = 315
  866. integer height = 96
  867. integer taborder = 90
  868. end type
  869. event clicked;call super::clicked;IF Trim(sle_bookname.Text) = '' THEN
  870. MessageBox('系统提示','请输入帐套!',information!,OK!)
  871. RETURN
  872. END IF
  873. IF Trim(sle_database.Text) = '' THEN
  874. MessageBox('系统提示','请输入数据库!',information!,OK!)
  875. RETURN
  876. END IF
  877. IF Trim(sle_server.Text) = '' THEN
  878. MessageBox('系统提示','请输入服务器!',information!,OK!)
  879. RETURN
  880. END IF
  881. IF rb_1.Checked THEN
  882. String ls_msg
  883. Int ll_rslt
  884. ll_rslt = wf_buildsqldb(ls_msg) //1-成功
  885. IF ll_rslt = 0 THEN //错误
  886. MessageBox("提示",ls_msg,information!,OK!)
  887. RETURN
  888. ELSEIF ll_rslt = 2 THEN //取消
  889. RETURN
  890. END IF
  891. END IF
  892. SetProfileString (sys_inifilename, 'database', 'dbms', sle_dbms.Text)
  893. SetProfileString (sys_inifilename, "database", "bookname", sle_bookname.Text )
  894. SetProfileString (sys_inifilename, "database", "database", sle_database.Text)
  895. SetProfileString (sys_inifilename, "database", "userid", sle_userid.Text)
  896. SetProfileString (sys_inifilename, "database", "dbpass", f_psw_bczh(sle_dbpass.Text,0,sys_power_key))
  897. SetProfileString (sys_inifilename, "database", "logid", sle_logid.Text)
  898. SetProfileString (sys_inifilename, "database", "LogPassWord", f_psw_bczh(sle_logpass.Text,0,sys_power_key))
  899. SetProfileString (sys_inifilename, "database", "servername", sle_server.Text)
  900. SetProfileString (sys_inifilename, "database", "dbparm", f_psw_bczh(sle_dbparm.Text,0,sys_power_key))
  901. SetProfileString (sys_inifilename, "database", "sqldb_mdf_sor", sle_sqldb_mdf_sor.Text)
  902. SetProfileString (sys_inifilename, "database", "sqldb_ldf_sor", sle_sqldb_ldf_sor.Text)
  903. //增加一个帐套
  904. String ls_ini_book
  905. Long id
  906. String ifuse
  907. IF IsNumber(is_bookcode) THEN
  908. id = Integer(is_bookcode)
  909. ELSE
  910. id = 1
  911. END IF
  912. String ls_temp
  913. ls_temp = Trim(sle_bookname.Text) + ':'+&
  914. Trim(sle_database.Text)+ ':'+&
  915. is_bookcode+':'+&
  916. '1'
  917. //SetProfileString (sys_inifilename_other,'sys_dl_book', '1', f_psw_bczh(ls_temp,0,sys_power_key))
  918. SetProfileString (sys_inifilename_other,'sys_dl_book', String(id), ls_temp)
  919. SetProfileString(sys_inifilename,'longjoews','LastAcount',Trim(sle_bookname.Text))
  920. SetProfileString (sys_inifilename, "database", "firstrun","0")
  921. MessageBox('提示','设置保存完成!系统必须重启!')
  922. Restart()
  923. end event
  924. type sle_logpass from singlelineedit within w_set_sqlca_ecl
  925. integer x = 416
  926. integer y = 804
  927. integer width = 1655
  928. integer height = 80
  929. integer taborder = 140
  930. integer textsize = -8
  931. integer weight = 400
  932. fontpitch fontpitch = variable!
  933. fontfamily fontfamily = swiss!
  934. string facename = "MS Sans Serif"
  935. long textcolor = 41943040
  936. boolean autohscroll = false
  937. boolean password = true
  938. borderstyle borderstyle = stylelowered!
  939. end type
  940. type sle_logid from singlelineedit within w_set_sqlca_ecl
  941. integer x = 416
  942. integer y = 708
  943. integer width = 1655
  944. integer height = 80
  945. integer taborder = 130
  946. integer textsize = -8
  947. integer weight = 400
  948. fontpitch fontpitch = variable!
  949. fontfamily fontfamily = swiss!
  950. string facename = "MS Sans Serif"
  951. long textcolor = 41943040
  952. boolean autohscroll = false
  953. borderstyle borderstyle = stylelowered!
  954. end type
  955. type sle_server from singlelineedit within w_set_sqlca_ecl
  956. integer x = 416
  957. integer y = 608
  958. integer width = 1655
  959. integer height = 80
  960. integer taborder = 120
  961. integer textsize = -8
  962. integer weight = 400
  963. fontpitch fontpitch = variable!
  964. fontfamily fontfamily = swiss!
  965. string facename = "MS Sans Serif"
  966. long textcolor = 41943040
  967. boolean autohscroll = false
  968. borderstyle borderstyle = stylelowered!
  969. end type
  970. type sle_database from singlelineedit within w_set_sqlca_ecl
  971. integer x = 416
  972. integer y = 276
  973. integer width = 1655
  974. integer height = 80
  975. integer taborder = 20
  976. integer textsize = -8
  977. integer weight = 400
  978. fontpitch fontpitch = variable!
  979. fontfamily fontfamily = swiss!
  980. string facename = "MS Sans Serif"
  981. long textcolor = 41943040
  982. boolean autohscroll = false
  983. borderstyle borderstyle = stylelowered!
  984. end type
  985. type sle_dbpass from singlelineedit within w_set_sqlca_ecl
  986. integer x = 2414
  987. integer y = 288
  988. integer width = 270
  989. integer height = 80
  990. integer taborder = 100
  991. integer textsize = -8
  992. integer weight = 400
  993. fontpitch fontpitch = variable!
  994. fontfamily fontfamily = swiss!
  995. string facename = "MS Sans Serif"
  996. long textcolor = 41943040
  997. boolean enabled = false
  998. boolean autohscroll = false
  999. boolean password = true
  1000. borderstyle borderstyle = stylelowered!
  1001. end type
  1002. type sle_userid from singlelineedit within w_set_sqlca_ecl
  1003. boolean visible = false
  1004. integer x = 2418
  1005. integer y = 372
  1006. integer width = 219
  1007. integer height = 80
  1008. integer taborder = 40
  1009. integer textsize = -8
  1010. integer weight = 400
  1011. fontcharset fontcharset = ansi!
  1012. fontpitch fontpitch = variable!
  1013. fontfamily fontfamily = swiss!
  1014. string facename = "MS Sans Serif"
  1015. long textcolor = 41943040
  1016. boolean enabled = false
  1017. boolean autohscroll = false
  1018. borderstyle borderstyle = stylelowered!
  1019. end type
  1020. type sle_dbparm from singlelineedit within w_set_sqlca_ecl
  1021. boolean visible = false
  1022. integer x = 384
  1023. integer y = 508
  1024. integer width = 306
  1025. integer height = 80
  1026. integer taborder = 250
  1027. integer textsize = -8
  1028. integer weight = 400
  1029. fontpitch fontpitch = variable!
  1030. fontfamily fontfamily = swiss!
  1031. string facename = "MS Sans Serif"
  1032. long textcolor = 41943040
  1033. borderstyle borderstyle = stylelowered!
  1034. end type
  1035. type st_9 from statictext within w_set_sqlca_ecl
  1036. boolean visible = false
  1037. integer x = 192
  1038. integer y = 656
  1039. integer width = 233
  1040. integer height = 60
  1041. integer textsize = -8
  1042. integer weight = 400
  1043. fontpitch fontpitch = variable!
  1044. fontfamily fontfamily = swiss!
  1045. string facename = "MS Sans Serif"
  1046. long textcolor = 41943040
  1047. long backcolor = 74481808
  1048. boolean enabled = false
  1049. string text = "DBPARM:"
  1050. alignment alignment = right!
  1051. boolean focusrectangle = false
  1052. end type
  1053. type st_6 from statictext within w_set_sqlca_ecl
  1054. integer x = 146
  1055. integer y = 812
  1056. integer width = 256
  1057. integer height = 60
  1058. integer textsize = -8
  1059. integer weight = 400
  1060. fontpitch fontpitch = variable!
  1061. fontfamily fontfamily = swiss!
  1062. string facename = "MS Sans Serif"
  1063. long textcolor = 41943040
  1064. long backcolor = 16777215
  1065. boolean enabled = false
  1066. string text = "登录 口令:"
  1067. alignment alignment = right!
  1068. boolean focusrectangle = false
  1069. end type
  1070. type st_5 from statictext within w_set_sqlca_ecl
  1071. integer x = 146
  1072. integer y = 720
  1073. integer width = 256
  1074. integer height = 60
  1075. integer textsize = -8
  1076. integer weight = 400
  1077. fontpitch fontpitch = variable!
  1078. fontfamily fontfamily = swiss!
  1079. string facename = "MS Sans Serif"
  1080. long textcolor = 41943040
  1081. long backcolor = 16777215
  1082. boolean enabled = false
  1083. string text = "登录 ID:"
  1084. alignment alignment = right!
  1085. boolean focusrectangle = false
  1086. end type
  1087. type st_4 from statictext within w_set_sqlca_ecl
  1088. boolean visible = false
  1089. integer x = 151
  1090. integer y = 216
  1091. integer width = 274
  1092. integer height = 60
  1093. integer textsize = -8
  1094. integer weight = 400
  1095. fontpitch fontpitch = variable!
  1096. fontfamily fontfamily = swiss!
  1097. string facename = "MS Sans Serif"
  1098. long textcolor = 41943040
  1099. long backcolor = 134217739
  1100. boolean enabled = false
  1101. string text = "口令:"
  1102. alignment alignment = right!
  1103. boolean focusrectangle = false
  1104. end type
  1105. type st_3 from statictext within w_set_sqlca_ecl
  1106. boolean visible = false
  1107. integer x = 187
  1108. integer y = 128
  1109. integer width = 238
  1110. integer height = 60
  1111. integer textsize = -8
  1112. integer weight = 400
  1113. fontpitch fontpitch = variable!
  1114. fontfamily fontfamily = swiss!
  1115. string facename = "MS Sans Serif"
  1116. long textcolor = 41943040
  1117. long backcolor = 134217739
  1118. boolean enabled = false
  1119. string text = "用户ID:"
  1120. alignment alignment = right!
  1121. boolean focusrectangle = false
  1122. end type
  1123. type st_2 from statictext within w_set_sqlca_ecl
  1124. integer x = 105
  1125. integer y = 288
  1126. integer width = 297
  1127. integer height = 60
  1128. integer textsize = -8
  1129. integer weight = 400
  1130. fontpitch fontpitch = variable!
  1131. fontfamily fontfamily = swiss!
  1132. string facename = "MS Sans Serif"
  1133. long textcolor = 41943040
  1134. long backcolor = 16777215
  1135. boolean enabled = false
  1136. string text = "数据库名称:"
  1137. alignment alignment = right!
  1138. boolean focusrectangle = false
  1139. end type
  1140. type st_00 from statictext within w_set_sqlca_ecl
  1141. boolean visible = false
  1142. integer x = 82
  1143. integer y = 40
  1144. integer width = 343
  1145. integer height = 60
  1146. integer textsize = -8
  1147. integer weight = 400
  1148. fontpitch fontpitch = variable!
  1149. fontfamily fontfamily = swiss!
  1150. string facename = "MS Sans Serif"
  1151. long backcolor = 134217739
  1152. boolean enabled = false
  1153. string text = "DBMS:"
  1154. alignment alignment = right!
  1155. boolean focusrectangle = false
  1156. end type
  1157. type st_7 from statictext within w_set_sqlca_ecl
  1158. integer x = 146
  1159. integer y = 620
  1160. integer width = 256
  1161. integer height = 60
  1162. integer textsize = -8
  1163. integer weight = 400
  1164. fontpitch fontpitch = variable!
  1165. fontfamily fontfamily = swiss!
  1166. string facename = "MS Sans Serif"
  1167. long textcolor = 41943040
  1168. long backcolor = 16777215
  1169. boolean enabled = false
  1170. string text = "服务器:"
  1171. alignment alignment = right!
  1172. boolean focusrectangle = false
  1173. end type
  1174. type sle_dbms from dropdownlistbox within w_set_sqlca_ecl
  1175. boolean visible = false
  1176. integer x = 443
  1177. integer y = 28
  1178. integer width = 1422
  1179. integer height = 156
  1180. integer taborder = 280
  1181. boolean bringtotop = true
  1182. integer textsize = -8
  1183. integer weight = 400
  1184. fontcharset fontcharset = ansi!
  1185. fontpitch fontpitch = variable!
  1186. fontfamily fontfamily = swiss!
  1187. string facename = "MS Sans Serif"
  1188. long textcolor = 33554432
  1189. boolean allowedit = true
  1190. boolean sorted = false
  1191. boolean vscrollbar = true
  1192. string item[] = {"ODBC","MSS Microsoft SQL Server 6.x"}
  1193. borderstyle borderstyle = stylelowered!
  1194. end type
  1195. event selectionchanged;wf_findisql()
  1196. end event
  1197. event modified;sle_dbms.postevent(selectionchanged!)
  1198. end event
  1199. type st_2334 from statictext within w_set_sqlca_ecl
  1200. boolean visible = false
  1201. integer x = 128
  1202. integer y = 1140
  1203. integer width = 329
  1204. integer height = 76
  1205. boolean bringtotop = true
  1206. integer textsize = -9
  1207. integer weight = 400
  1208. fontcharset fontcharset = gb2312charset!
  1209. fontpitch fontpitch = variable!
  1210. string facename = "宋体"
  1211. long textcolor = 33554432
  1212. long backcolor = 134217739
  1213. boolean enabled = false
  1214. string text = "源数据名称:"
  1215. alignment alignment = right!
  1216. boolean focusrectangle = false
  1217. end type
  1218. type st_345 from statictext within w_set_sqlca_ecl
  1219. boolean visible = false
  1220. integer x = 128
  1221. integer y = 1232
  1222. integer width = 329
  1223. integer height = 76
  1224. boolean bringtotop = true
  1225. integer textsize = -9
  1226. integer weight = 400
  1227. fontcharset fontcharset = gb2312charset!
  1228. fontpitch fontpitch = variable!
  1229. string facename = "宋体"
  1230. long textcolor = 33554432
  1231. long backcolor = 134217739
  1232. boolean enabled = false
  1233. string text = "源日志名称:"
  1234. alignment alignment = right!
  1235. boolean focusrectangle = false
  1236. end type
  1237. type sle_sqldb_mdf_sor from singlelineedit within w_set_sqlca_ecl
  1238. boolean visible = false
  1239. integer x = 457
  1240. integer y = 1124
  1241. integer width = 1655
  1242. integer height = 80
  1243. integer taborder = 180
  1244. integer textsize = -9
  1245. integer weight = 400
  1246. fontcharset fontcharset = gb2312charset!
  1247. fontpitch fontpitch = variable!
  1248. string facename = "宋体"
  1249. long textcolor = 33554432
  1250. borderstyle borderstyle = stylelowered!
  1251. end type
  1252. type sle_sqldb_ldf_sor from singlelineedit within w_set_sqlca_ecl
  1253. boolean visible = false
  1254. integer x = 457
  1255. integer y = 1216
  1256. integer width = 1655
  1257. integer height = 80
  1258. integer taborder = 220
  1259. integer textsize = -9
  1260. integer weight = 400
  1261. fontcharset fontcharset = gb2312charset!
  1262. fontpitch fontpitch = variable!
  1263. string facename = "宋体"
  1264. long textcolor = 33554432
  1265. borderstyle borderstyle = stylelowered!
  1266. end type
  1267. type st_jd from statictext within w_set_sqlca_ecl
  1268. integer x = 1486
  1269. integer y = 40
  1270. integer width = 768
  1271. integer height = 84
  1272. boolean bringtotop = true
  1273. integer textsize = -9
  1274. integer weight = 400
  1275. fontcharset fontcharset = gb2312charset!
  1276. fontpitch fontpitch = variable!
  1277. string facename = "宋体"
  1278. long textcolor = 16711680
  1279. long backcolor = 16777215
  1280. boolean enabled = false
  1281. boolean focusrectangle = false
  1282. end type
  1283. type st_1 from statictext within w_set_sqlca_ecl
  1284. integer x = 146
  1285. integer y = 172
  1286. integer width = 256
  1287. integer height = 60
  1288. boolean bringtotop = true
  1289. integer textsize = -8
  1290. integer weight = 400
  1291. fontpitch fontpitch = variable!
  1292. fontfamily fontfamily = swiss!
  1293. string facename = "MS Sans Serif"
  1294. long textcolor = 41943040
  1295. long backcolor = 16777215
  1296. boolean enabled = false
  1297. string text = "帐套名称:"
  1298. alignment alignment = right!
  1299. boolean focusrectangle = false
  1300. end type
  1301. type sle_bookname from singlelineedit within w_set_sqlca_ecl
  1302. integer x = 416
  1303. integer y = 160
  1304. integer width = 1655
  1305. integer height = 80
  1306. integer taborder = 10
  1307. boolean bringtotop = true
  1308. integer textsize = -8
  1309. integer weight = 400
  1310. fontpitch fontpitch = variable!
  1311. fontfamily fontfamily = swiss!
  1312. string facename = "MS Sans Serif"
  1313. long textcolor = 41943040
  1314. string text = "演示帐套"
  1315. boolean autohscroll = false
  1316. borderstyle borderstyle = stylelowered!
  1317. end type
  1318. type sle_fjname from singlelineedit within w_set_sqlca_ecl
  1319. integer x = 416
  1320. integer y = 1100
  1321. integer width = 1655
  1322. integer height = 80
  1323. integer taborder = 160
  1324. boolean bringtotop = true
  1325. integer textsize = -9
  1326. integer weight = 400
  1327. fontcharset fontcharset = gb2312charset!
  1328. fontpitch fontpitch = variable!
  1329. string facename = "宋体"
  1330. long textcolor = 33554432
  1331. borderstyle borderstyle = stylelowered!
  1332. end type
  1333. type cb_ch3 from commandbutton within w_set_sqlca_ecl
  1334. integer x = 2075
  1335. integer y = 1092
  1336. integer width = 114
  1337. integer height = 84
  1338. integer taborder = 210
  1339. boolean bringtotop = true
  1340. integer textsize = -9
  1341. integer weight = 400
  1342. fontcharset fontcharset = gb2312charset!
  1343. fontpitch fontpitch = variable!
  1344. string facename = "宋体"
  1345. string text = "..."
  1346. end type
  1347. event clicked;
  1348. Integer i
  1349. String Pathname,Filename
  1350. i = GetFileSaveName("选择备份文件",Pathname,Filename,"Dat","数据文件Dat,*.Dat")
  1351. IF i = 1 AND Trim(Pathname) <> '' AND Trim(Filename) <> "" THEN
  1352. sle_fjname.Text = Pathname
  1353. END IF
  1354. end event
  1355. type cb_1 from commandbutton within w_set_sqlca_ecl
  1356. integer x = 1915
  1357. integer y = 392
  1358. integer width = 82
  1359. integer height = 84
  1360. integer taborder = 60
  1361. boolean bringtotop = true
  1362. integer textsize = -9
  1363. integer weight = 400
  1364. fontcharset fontcharset = gb2312charset!
  1365. fontpitch fontpitch = variable!
  1366. string facename = "宋体"
  1367. string text = "︾"
  1368. end type
  1369. event clicked;IF cb_1.Text = '︽' THEN
  1370. cb_1.Text = '︾'
  1371. ELSE
  1372. cb_1.Text = '︽'
  1373. END IF
  1374. wf_facechange()
  1375. //IF THIS.Text <> '︽' THEN
  1376. // PARENT.Height = 1700 //PARENT.Height + 1000
  1377. // THIS.Text = '︽'
  1378. //
  1379. // gb_1.visible = true
  1380. // st_7.visible = true
  1381. // sle_server.visible = true
  1382. // st_5.visible = true
  1383. // sle_logid.visible = true
  1384. // st_6.visible = true
  1385. // sle_logpass.visible = true
  1386. //
  1387. // cb_ok.y = 1436
  1388. // cb_exit.y = 1436
  1389. //ELSE
  1390. // PARENT.Height = 780 //PARENT.Height - 1000
  1391. // THIS.Text = '︾'
  1392. //
  1393. // gb_1.visible = false
  1394. // st_7.visible = false
  1395. // sle_server.visible = false
  1396. // st_5.visible = false
  1397. // sle_logid.visible = false
  1398. // st_6.visible = false
  1399. // sle_logpass.visible = false
  1400. //
  1401. // cb_ok.y = 532
  1402. // cb_exit.y = 532
  1403. //
  1404. //END IF
  1405. end event
  1406. type st_11 from statictext within w_set_sqlca_ecl
  1407. integer x = 2007
  1408. integer y = 412
  1409. integer width = 233
  1410. integer height = 48
  1411. boolean bringtotop = true
  1412. integer textsize = -9
  1413. integer weight = 400
  1414. fontcharset fontcharset = gb2312charset!
  1415. fontpitch fontpitch = variable!
  1416. string facename = "宋体"
  1417. long textcolor = 33554432
  1418. long backcolor = 16777215
  1419. string text = "高级选项"
  1420. boolean focusrectangle = false
  1421. end type
  1422. type ddlb_1 from dropdownlistbox within w_set_sqlca_ecl
  1423. integer x = 416
  1424. integer y = 400
  1425. integer width = 1166
  1426. integer height = 300
  1427. integer taborder = 30
  1428. boolean bringtotop = true
  1429. integer textsize = -9
  1430. integer weight = 400
  1431. fontcharset fontcharset = gb2312charset!
  1432. fontpitch fontpitch = variable!
  1433. string facename = "宋体"
  1434. long textcolor = 33554432
  1435. borderstyle borderstyle = stylelowered!
  1436. end type
  1437. event selectionchanged;sle_filename.text = sys_cur_path + this.text + '.dat'
  1438. end event
  1439. type st_12 from statictext within w_set_sqlca_ecl
  1440. integer x = 105
  1441. integer y = 408
  1442. integer width = 297
  1443. integer height = 60
  1444. boolean bringtotop = true
  1445. integer textsize = -8
  1446. integer weight = 400
  1447. fontpitch fontpitch = variable!
  1448. fontfamily fontfamily = swiss!
  1449. string facename = "MS Sans Serif"
  1450. long textcolor = 41943040
  1451. long backcolor = 16777215
  1452. boolean enabled = false
  1453. string text = "数据库来源:"
  1454. alignment alignment = right!
  1455. boolean focusrectangle = false
  1456. end type
  1457. type rb_1 from radiobutton within w_set_sqlca_ecl
  1458. integer x = 453
  1459. integer y = 40
  1460. integer width = 402
  1461. integer height = 60
  1462. boolean bringtotop = true
  1463. integer textsize = -9
  1464. integer weight = 400
  1465. fontcharset fontcharset = gb2312charset!
  1466. fontpitch fontpitch = variable!
  1467. string facename = "宋体"
  1468. long textcolor = 33554432
  1469. long backcolor = 16777215
  1470. boolean enabled = false
  1471. string text = "新建数据库"
  1472. end type
  1473. event clicked;wf_facechange()
  1474. end event
  1475. type rb_2 from radiobutton within w_set_sqlca_ecl
  1476. integer x = 882
  1477. integer y = 40
  1478. integer width = 466
  1479. integer height = 60
  1480. boolean bringtotop = true
  1481. integer textsize = -9
  1482. integer weight = 400
  1483. fontcharset fontcharset = gb2312charset!
  1484. fontpitch fontpitch = variable!
  1485. string facename = "宋体"
  1486. long textcolor = 33554432
  1487. long backcolor = 16777215
  1488. string text = "连接现有数据库"
  1489. boolean checked = true
  1490. end type
  1491. event clicked;cb_1.Text = '︾'
  1492. wf_facechange()
  1493. // ddlb_1.Enabled = False
  1494. // cbx_modify.Enabled = False
  1495. // sle_filename.Enabled = False
  1496. // cb_ch2.Enabled = False
  1497. // sle_fjname.Enabled = False
  1498. // cb_ch3.Enabled = False
  1499. // sle_folder.Enabled = False
  1500. // cb_2.Enabled = False
  1501. // cbx_fj.Enabled = False
  1502. // st_1.Enabled = False
  1503. // st_12.Enabled = False
  1504. // st_8.Enabled = False
  1505. // st_13.Enabled = False
  1506. // cbx_yj.Enabled = False
  1507. // sle_yjname.Enabled = False
  1508. // cb_ch4.Enabled = False
  1509. //
  1510. // This.Height = 780
  1511. // cb_1.Text = '︾'
  1512. //
  1513. // gb_1.Visible = False
  1514. // st_7.Visible = False
  1515. // sle_server.Visible = False
  1516. // st_5.Visible = False
  1517. // sle_logid.Visible = False
  1518. // st_6.Visible = False
  1519. // sle_logpass.Visible = False
  1520. //
  1521. // cb_ok.Y = 532
  1522. // cb_exit.Y = 532
  1523. end event
  1524. type sle_filename from singlelineedit within w_set_sqlca_ecl
  1525. integer x = 416
  1526. integer y = 996
  1527. integer width = 1655
  1528. integer height = 80
  1529. integer taborder = 150
  1530. boolean bringtotop = true
  1531. integer textsize = -9
  1532. integer weight = 400
  1533. fontcharset fontcharset = gb2312charset!
  1534. fontpitch fontpitch = variable!
  1535. string facename = "宋体"
  1536. long textcolor = 33554432
  1537. boolean enabled = false
  1538. borderstyle borderstyle = stylelowered!
  1539. end type
  1540. type cb_ch2 from commandbutton within w_set_sqlca_ecl
  1541. integer x = 2075
  1542. integer y = 992
  1543. integer width = 114
  1544. integer height = 84
  1545. integer taborder = 200
  1546. boolean bringtotop = true
  1547. integer textsize = -9
  1548. integer weight = 400
  1549. fontcharset fontcharset = gb2312charset!
  1550. fontpitch fontpitch = variable!
  1551. string facename = "宋体"
  1552. boolean enabled = false
  1553. string text = "..."
  1554. end type
  1555. event clicked;
  1556. Integer i
  1557. String Pathname,Filename
  1558. i = GetFileSaveName("选择备份文件",Pathname,Filename,"Dat","数据文件Dat,*.Dat")
  1559. IF i = 1 AND Trim(Pathname) <> '' AND Trim(Filename) <> "" THEN
  1560. sle_filename.Text = Pathname
  1561. END IF
  1562. end event
  1563. type st_13 from statictext within w_set_sqlca_ecl
  1564. integer x = 46
  1565. integer y = 1332
  1566. integer width = 370
  1567. integer height = 76
  1568. boolean bringtotop = true
  1569. integer textsize = -9
  1570. integer weight = 400
  1571. fontcharset fontcharset = gb2312charset!
  1572. fontpitch fontpitch = variable!
  1573. string facename = "宋体"
  1574. long textcolor = 33554432
  1575. long backcolor = 16777215
  1576. boolean enabled = false
  1577. string text = "目标文件路径:"
  1578. alignment alignment = right!
  1579. boolean focusrectangle = false
  1580. end type
  1581. type sle_folder from singlelineedit within w_set_sqlca_ecl
  1582. integer x = 416
  1583. integer y = 1316
  1584. integer width = 1655
  1585. integer height = 80
  1586. integer taborder = 190
  1587. boolean bringtotop = true
  1588. integer textsize = -9
  1589. integer weight = 400
  1590. fontcharset fontcharset = gb2312charset!
  1591. fontpitch fontpitch = variable!
  1592. string facename = "宋体"
  1593. long textcolor = 33554432
  1594. borderstyle borderstyle = stylelowered!
  1595. end type
  1596. type cb_2 from commandbutton within w_set_sqlca_ecl
  1597. integer x = 2075
  1598. integer y = 1312
  1599. integer width = 114
  1600. integer height = 84
  1601. integer taborder = 240
  1602. boolean bringtotop = true
  1603. integer textsize = -9
  1604. integer weight = 400
  1605. fontcharset fontcharset = gb2312charset!
  1606. fontpitch fontpitch = variable!
  1607. string facename = "宋体"
  1608. string text = "..."
  1609. end type
  1610. event clicked;
  1611. //
  1612. //GetFolder()
  1613. //功 能:显示文件夹选择对话框。
  1614. //语 法:GetFolder (title , director )
  1615. //参 数:title:String类型,指定文件夹选择框的标题;
  1616. // directory:String类型,文件夹的路径,即指定显示哪个文件夹下的子文件夹,又用于保存用户最终选择的文件夹的路径。
  1617. //返回值:Integer。函数执行成功时返回1,发生错误时返回-1。当用户选择了”取消”按钮或直接关闭对话框,函数返回0。
  1618. //示 例:This example displays the folder contents of the Sybase directory in a folder selection dialog box. The string passed in the title argument displays above the tree view:
  1619. string ls_path
  1620. integer li_result
  1621. ls_path = mid(sys_cur_path,1,len(sys_cur_path )- 1)
  1622. li_result = GetFolder( "目标文件路径", ls_path )
  1623. sle_folder.text=ls_path
  1624. end event
  1625. type cbx_modify from checkbox within w_set_sqlca_ecl
  1626. integer x = 1595
  1627. integer y = 408
  1628. integer width = 311
  1629. integer height = 60
  1630. integer taborder = 50
  1631. boolean bringtotop = true
  1632. integer textsize = -9
  1633. integer weight = 400
  1634. fontcharset fontcharset = gb2312charset!
  1635. fontpitch fontpitch = variable!
  1636. string facename = "宋体"
  1637. long textcolor = 33554432
  1638. long backcolor = 16777215
  1639. string text = "手动修改"
  1640. end type
  1641. event clicked;IF THIS.Checked THEN
  1642. ddlb_1.Enabled = FALSE
  1643. cb_ch2.Enabled = TRUE
  1644. sle_filename.Enabled = TRUE
  1645. sle_filename.text = ''
  1646. ELSE
  1647. ddlb_1.Enabled = TRUE
  1648. cb_ch2.Enabled = FALSE
  1649. sle_filename.Enabled = FALSE
  1650. sle_filename.text = sys_cur_path + ddlb_1.text + '.dat'
  1651. END IF
  1652. end event
  1653. type st_8 from statictext within w_set_sqlca_ecl
  1654. integer x = 46
  1655. integer y = 1008
  1656. integer width = 370
  1657. integer height = 76
  1658. boolean bringtotop = true
  1659. integer textsize = -9
  1660. integer weight = 400
  1661. fontcharset fontcharset = gb2312charset!
  1662. fontpitch fontpitch = variable!
  1663. string facename = "宋体"
  1664. long textcolor = 33554432
  1665. long backcolor = 16777215
  1666. boolean enabled = false
  1667. string text = "主数据库:"
  1668. alignment alignment = right!
  1669. boolean focusrectangle = false
  1670. end type
  1671. type cbx_fj from checkbox within w_set_sqlca_ecl
  1672. integer x = 41
  1673. integer y = 1112
  1674. integer width = 375
  1675. integer height = 60
  1676. boolean bringtotop = true
  1677. integer textsize = -9
  1678. integer weight = 400
  1679. fontcharset fontcharset = gb2312charset!
  1680. fontpitch fontpitch = variable!
  1681. string facename = "宋体"
  1682. long textcolor = 33554432
  1683. long backcolor = 16777215
  1684. string text = "附件数据库:"
  1685. boolean checked = true
  1686. end type
  1687. event clicked;if rb_2.checked then return
  1688. IF cbx_fj.Checked THEN
  1689. sle_fjname.Enabled = TRUE
  1690. cb_ch3.Enabled = TRUE
  1691. ELSE
  1692. sle_fjname.Enabled = FALSE
  1693. cb_ch3.Enabled = FALSE
  1694. END IF
  1695. end event
  1696. type st_10 from statictext within w_set_sqlca_ecl
  1697. integer x = 82
  1698. integer y = 44
  1699. integer width = 325
  1700. integer height = 60
  1701. boolean bringtotop = true
  1702. integer textsize = -8
  1703. integer weight = 400
  1704. fontpitch fontpitch = variable!
  1705. fontfamily fontfamily = swiss!
  1706. string facename = "MS Sans Serif"
  1707. long textcolor = 41943040
  1708. long backcolor = 16777215
  1709. boolean enabled = false
  1710. string text = "初始化类型:"
  1711. alignment alignment = right!
  1712. boolean focusrectangle = false
  1713. end type
  1714. type cbx_yj from checkbox within w_set_sqlca_ecl
  1715. integer x = 41
  1716. integer y = 1220
  1717. integer width = 384
  1718. integer height = 60
  1719. boolean bringtotop = true
  1720. integer textsize = -9
  1721. integer weight = 400
  1722. fontcharset fontcharset = gb2312charset!
  1723. fontpitch fontpitch = variable!
  1724. string facename = "宋体"
  1725. long textcolor = 33554432
  1726. long backcolor = 16777215
  1727. string text = "邮件数据库:"
  1728. boolean checked = true
  1729. end type
  1730. event clicked;IF rb_2.Checked THEN RETURN
  1731. IF cbx_yj.Checked THEN
  1732. sle_yjname.Enabled = TRUE
  1733. cb_ch4.Enabled = TRUE
  1734. ELSE
  1735. sle_yjname.Enabled = FALSE
  1736. cb_ch4.Enabled = FALSE
  1737. END IF
  1738. end event
  1739. type sle_yjname from singlelineedit within w_set_sqlca_ecl
  1740. integer x = 416
  1741. integer y = 1208
  1742. integer width = 1655
  1743. integer height = 80
  1744. integer taborder = 170
  1745. boolean bringtotop = true
  1746. integer textsize = -9
  1747. integer weight = 400
  1748. fontcharset fontcharset = gb2312charset!
  1749. fontpitch fontpitch = variable!
  1750. string facename = "宋体"
  1751. long textcolor = 33554432
  1752. borderstyle borderstyle = stylelowered!
  1753. end type
  1754. type cb_ch4 from commandbutton within w_set_sqlca_ecl
  1755. integer x = 2075
  1756. integer y = 1200
  1757. integer width = 114
  1758. integer height = 84
  1759. integer taborder = 230
  1760. boolean bringtotop = true
  1761. integer textsize = -9
  1762. integer weight = 400
  1763. fontcharset fontcharset = gb2312charset!
  1764. fontpitch fontpitch = variable!
  1765. string facename = "宋体"
  1766. string text = "..."
  1767. end type
  1768. event clicked;
  1769. Integer i
  1770. String Pathname,Filename
  1771. i = GetFileSaveName("选择备份文件",Pathname,Filename,"Dat","数据文件Dat,*.Dat")
  1772. IF i = 1 AND Trim(Pathname) <> '' AND Trim(Filename) <> "" THEN
  1773. sle_yjname.Text = Pathname
  1774. END IF
  1775. end event
  1776. type cb_connect from uo_imflatbutton within w_set_sqlca_ecl
  1777. integer x = 416
  1778. integer y = 524
  1779. integer width = 315
  1780. integer height = 96
  1781. integer taborder = 80
  1782. boolean bringtotop = true
  1783. string text = "测试连接"
  1784. end type
  1785. event clicked;call super::clicked;IF Trim(sle_bookname.Text) = '' THEN
  1786. MessageBox('系统提示','请输入帐套!',information!,OK!)
  1787. RETURN
  1788. END IF
  1789. IF Trim(sle_database.Text) = '' THEN
  1790. MessageBox('系统提示','请输入数据库!',information!,OK!)
  1791. RETURN
  1792. END IF
  1793. IF Trim(sle_server.Text) = '' THEN
  1794. MessageBox('系统提示','请输入服务器!',information!,OK!)
  1795. RETURN
  1796. END IF
  1797. IF Trim(sle_logid.Text) = '' THEN
  1798. MessageBox('系统提示','请输入登陆ID!',information!,OK!)
  1799. RETURN
  1800. END IF
  1801. Open(w_sys_wait)
  1802. w_sys_wait.wf_set_msg("正在尝试连接数据库,此过程预计需要用时1分钟...")
  1803. Transaction db_Transaction
  1804. db_Transaction = Create Transaction
  1805. db_Transaction.DBMS = "SNC SQL Native Client(OLE DB)"
  1806. db_Transaction.Database = sle_database.Text
  1807. db_Transaction.UserID = sle_logid.Text
  1808. db_Transaction.DBPass = sle_logpass.Text
  1809. db_Transaction.LogID = sle_logid.Text
  1810. db_Transaction.LogPass = sle_logpass.Text
  1811. db_Transaction.ServerName = sle_server.Text
  1812. db_Transaction.Lock = "RU"
  1813. db_Transaction.AutoCommit = False
  1814. db_Transaction.DBParm = "Database= '" + sle_database.Text + "',PBTrimCharColumns='YES'"
  1815. CONNECT Using db_Transaction;
  1816. Int rslt = 1
  1817. String arg_msg = ''
  1818. IF db_Transaction.SQLCode < 0 THEN
  1819. rslt = 0
  1820. arg_msg = "连接数据库失败!"
  1821. IF Pos(db_Transaction.SQLErrText, "'"+sle_logid.Text+"'") > 0 THEN
  1822. arg_msg = arg_msg + "用户密码错误!"
  1823. cb_1.Text = '︽'
  1824. wf_facechange()
  1825. sle_logpass.SetFocus()
  1826. END IF
  1827. IF rb_1.Checked And Pos(db_Transaction.SQLErrText, "'"+sle_database.Text+"'") > 0 THEN
  1828. rslt = 1
  1829. END IF
  1830. ELSE
  1831. rslt = 1
  1832. END IF
  1833. DISCONNECT Using db_Transaction;
  1834. Destroy db_Transaction;
  1835. Close(w_sys_wait)
  1836. IF rslt = 0 THEN
  1837. MessageBox("系统提示",arg_msg)
  1838. ELSE
  1839. MessageBox("系统提示","连接数据库成功!")
  1840. END IF
  1841. end event
  1842. type gb_1 from groupbox within w_set_sqlca_ecl
  1843. integer x = 18
  1844. integer y = 540
  1845. integer width = 2217
  1846. integer height = 392
  1847. integer taborder = 260
  1848. integer textsize = -9
  1849. integer weight = 400
  1850. fontcharset fontcharset = gb2312charset!
  1851. fontpitch fontpitch = variable!
  1852. string facename = "宋体"
  1853. long textcolor = 33554432
  1854. long backcolor = 16777215
  1855. end type
  1856. type gb_2 from groupbox within w_set_sqlca_ecl
  1857. integer x = 18
  1858. integer y = 936
  1859. integer width = 2217
  1860. integer height = 484
  1861. integer taborder = 270
  1862. integer textsize = -9
  1863. integer weight = 400
  1864. fontcharset fontcharset = gb2312charset!
  1865. fontpitch fontpitch = variable!
  1866. string facename = "宋体"
  1867. long textcolor = 33554432
  1868. long backcolor = 16777215
  1869. end type
  1870. type gb_3 from groupbox within w_set_sqlca_ecl
  1871. integer x = 411
  1872. integer width = 1051
  1873. integer height = 120
  1874. integer taborder = 290
  1875. integer textsize = -9
  1876. integer weight = 400
  1877. fontcharset fontcharset = gb2312charset!
  1878. fontpitch fontpitch = variable!
  1879. string facename = "宋体"
  1880. long textcolor = 16711680
  1881. long backcolor = 16777215
  1882. end type