w_set_sqlca.srw 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471
  1. $PBExportHeader$w_set_sqlca.srw
  2. $PBExportComments$数据库连接窗口
  3. forward
  4. global type w_set_sqlca from w_publ_base
  5. end type
  6. type cb_ok from uo_imflatbutton within w_set_sqlca
  7. end type
  8. type sle_logpass from singlelineedit within w_set_sqlca
  9. end type
  10. type sle_logid from singlelineedit within w_set_sqlca
  11. end type
  12. type sle_server from singlelineedit within w_set_sqlca
  13. end type
  14. type sle_database from singlelineedit within w_set_sqlca
  15. end type
  16. type sle_dbpass from singlelineedit within w_set_sqlca
  17. end type
  18. type sle_userid from singlelineedit within w_set_sqlca
  19. end type
  20. type sle_dbparm from singlelineedit within w_set_sqlca
  21. end type
  22. type st_9 from statictext within w_set_sqlca
  23. end type
  24. type st_6 from statictext within w_set_sqlca
  25. end type
  26. type st_5 from statictext within w_set_sqlca
  27. end type
  28. type st_4 from statictext within w_set_sqlca
  29. end type
  30. type st_3 from statictext within w_set_sqlca
  31. end type
  32. type st_2 from statictext within w_set_sqlca
  33. end type
  34. type st_00 from statictext within w_set_sqlca
  35. end type
  36. type st_7 from statictext within w_set_sqlca
  37. end type
  38. type cb_ch2 from commandbutton within w_set_sqlca
  39. end type
  40. type sle_filename from singlelineedit within w_set_sqlca
  41. end type
  42. type cbx_addnewdatabase from checkbox within w_set_sqlca
  43. end type
  44. type rb_server from radiobutton within w_set_sqlca
  45. end type
  46. type rb_2 from radiobutton within w_set_sqlca
  47. end type
  48. type sle_dbms from dropdownlistbox within w_set_sqlca
  49. end type
  50. type st_8 from statictext within w_set_sqlca
  51. end type
  52. type sle_sqldb_mdf from singlelineedit within w_set_sqlca
  53. end type
  54. type sle_sqldb_ldf from singlelineedit within w_set_sqlca
  55. end type
  56. type st_91 from statictext within w_set_sqlca
  57. end type
  58. type st_912 from statictext within w_set_sqlca
  59. end type
  60. type cb_sqldb_mdf from commandbutton within w_set_sqlca
  61. end type
  62. type cb_sqldb_ldf from commandbutton within w_set_sqlca
  63. end type
  64. type gb_1 from groupbox within w_set_sqlca
  65. end type
  66. type st_193 from statictext within w_set_sqlca
  67. end type
  68. type st_2334 from statictext within w_set_sqlca
  69. end type
  70. type st_345 from statictext within w_set_sqlca
  71. end type
  72. type sle_sqldb_mdf_sor from singlelineedit within w_set_sqlca
  73. end type
  74. type sle_sqldb_ldf_sor from singlelineedit within w_set_sqlca
  75. end type
  76. type cbx_db_h from checkbox within w_set_sqlca
  77. end type
  78. type gb_3 from groupbox within w_set_sqlca
  79. end type
  80. type st_jd from statictext within w_set_sqlca
  81. end type
  82. type st_1 from statictext within w_set_sqlca
  83. end type
  84. type sle_bookname from singlelineedit within w_set_sqlca
  85. end type
  86. end forward
  87. global type w_set_sqlca from w_publ_base
  88. integer x = 283
  89. integer y = 12
  90. integer width = 2331
  91. integer height = 1580
  92. string title = "帐套连接设置"
  93. boolean minbox = false
  94. windowtype windowtype = response!
  95. cb_ok cb_ok
  96. sle_logpass sle_logpass
  97. sle_logid sle_logid
  98. sle_server sle_server
  99. sle_database sle_database
  100. sle_dbpass sle_dbpass
  101. sle_userid sle_userid
  102. sle_dbparm sle_dbparm
  103. st_9 st_9
  104. st_6 st_6
  105. st_5 st_5
  106. st_4 st_4
  107. st_3 st_3
  108. st_2 st_2
  109. st_00 st_00
  110. st_7 st_7
  111. cb_ch2 cb_ch2
  112. sle_filename sle_filename
  113. cbx_addnewdatabase cbx_addnewdatabase
  114. rb_server rb_server
  115. rb_2 rb_2
  116. sle_dbms sle_dbms
  117. st_8 st_8
  118. sle_sqldb_mdf sle_sqldb_mdf
  119. sle_sqldb_ldf sle_sqldb_ldf
  120. st_91 st_91
  121. st_912 st_912
  122. cb_sqldb_mdf cb_sqldb_mdf
  123. cb_sqldb_ldf cb_sqldb_ldf
  124. gb_1 gb_1
  125. st_193 st_193
  126. st_2334 st_2334
  127. st_345 st_345
  128. sle_sqldb_mdf_sor sle_sqldb_mdf_sor
  129. sle_sqldb_ldf_sor sle_sqldb_ldf_sor
  130. cbx_db_h cbx_db_h
  131. gb_3 gb_3
  132. st_jd st_jd
  133. st_1 st_1
  134. sle_bookname sle_bookname
  135. end type
  136. global w_set_sqlca w_set_sqlca
  137. type prototypes
  138. Subroutine Sleep(ulong dwMilliseconds) LIBRARY "kernel32.dll"
  139. Function long ShellExecuteA (long hwnd, string lpOperation ,String lpFile, String lpParameters, String lpDirectory, Long nShowCmd) Library "shell32.dll" alias for "ShellExecuteA;Ansi"
  140. end prototypes
  141. type variables
  142. INT ARROWADDNEW
  143. string ls_bat_filename='_ls_cmd_run.bat'
  144. string ls_txt_filename='_ls_cmd_rslt.txt'
  145. string masterpath
  146. end variables
  147. forward prototypes
  148. public function integer wf_autobuiltmdflogname ()
  149. public function integer wf_buildsqldb ()
  150. public function integer wf_findisql ()
  151. public subroutine wf_face_change ()
  152. end prototypes
  153. public function integer wf_autobuiltmdflogname ();//wf_autobuiltmdflogname
  154. sle_sqldb_ldf.text=masterpath+sle_database.text+'_log.ldf'
  155. sle_sqldb_mdf.text=masterpath+sle_database.text+'_data.MDF'
  156. return 1
  157. end function
  158. public function integer wf_buildsqldb ();//wf_buildsqldb
  159. Integer li_FileNum,rslt = 1
  160. String comm,msg
  161. Long i,j,lu_return
  162. comm = ' create DATABASE '+sle_database.Text+&
  163. " on(name='"+sle_sqldb_mdf_sor.Text+"',FILENAME= '"+sle_sqldb_mdf.Text+"') log on (name='"+sle_sqldb_ldf_sor.Text+"',FILENAME= '"+sle_sqldb_ldf.Text+"')"
  164. //sqlca.DBMS = ProfileString (sys_inifilename, "database", "dbms", "")
  165. sqlca.Database = 'master'
  166. //sqlca.userid = ProfileString (sys_inifilename, "database", "userid", "")
  167. //sqlca.dbpass = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbpass", ""),1,sys_power_key)
  168. sqlca.LogID = sle_logid.Text
  169. sqlca.LogPass = sle_logpass.Text
  170. sqlca.ServerName = sle_server.Text
  171. //sqlca.dbparm = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbparm", ""),1,sys_power_key)
  172. IF sqlca.Database = '' Or sqlca.ServerName = '' THEN
  173. MessageBox("系统提示","连接数据管理库失败!")
  174. RETURN 0
  175. END IF
  176. CONNECT Using sqlca;
  177. sqlca.AutoCommit = True
  178. st_jd.Text = '正在新建数据库...'
  179. EXECUTE Immediate :comm Using sqlca;
  180. IF sqlca.SQLCode <> 0 THEN
  181. msg = '建立失败,请手动建立及恢复数据库>'+sqlca.SQLErrText
  182. ROLLBACK;
  183. MessageBox('系统提示',msg)
  184. rslt = 0
  185. GOTO ext
  186. ELSE
  187. rslt = 1
  188. COMMIT;
  189. END IF
  190. st_jd.Text = '正在恢复数据库...'
  191. comm = 'RESTORE DATABASE '+sle_database.Text+" from DISK= '"+sle_filename.Text+"'"+&
  192. " WITH MOVE '"+sle_sqldb_mdf_sor.Text+"' TO '"+sle_sqldb_mdf.Text+"',"+&
  193. " MOVE '"+sle_sqldb_ldf_sor.Text+"' TO '"+sle_sqldb_ldf.Text+"',"+'REPLACE'
  194. EXECUTE Immediate :comm Using sqlca;
  195. IF sqlca.SQLCode <> 0 THEN
  196. msg = '恢复失败,请手动恢复数据库>'+sqlca.SQLErrText
  197. ROLLBACK;
  198. MessageBox('系统提示',msg)
  199. rslt = 0
  200. ELSE
  201. rslt = 1
  202. COMMIT;
  203. END IF
  204. ext:
  205. RETURN rslt
  206. end function
  207. public function integer wf_findisql ();//wf_findisql
  208. IF FILEEXISTs('c:\mssql7\data\master.mdf') then
  209. masterpath='c:\mssql7\data\'
  210. goto ext
  211. end if
  212. IF FILEEXISTs('c:\Program Files\Microsoft SQL Server\80\data\master.mdf') then
  213. masterpath='c:\Program Files\Microsoft SQL Server\data\'
  214. goto ext
  215. end if
  216. IF fileexists('c:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') then
  217. masterpath="c:\Program Files\Microsoft SQL Server\MSSQL\data\"
  218. goto ext
  219. end if
  220. IF FILEEXISTs('d:\mssql7\data\master.mdf') then
  221. masterpath='d:\mssql7\data\'
  222. goto ext
  223. end if
  224. IF FILEEXISTs('d:\Program Files\Microsoft SQL Server\80\data\master.mdf') then
  225. masterpath='d:\Program Files\Microsoft SQL Server\data\'
  226. goto ext
  227. end if
  228. IF FILEEXISTs('d:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') then
  229. masterpath='d:\Program Files\Microsoft SQL Server\MSSQL\data\'
  230. goto ext
  231. end if
  232. IF FILEEXISTs('e:\mssql7\data\master.mdf') then
  233. masterpath='e:\mssql7\data\'
  234. goto ext
  235. end if
  236. IF FILEEXISTs('e:\Program Files\Microsoft SQL Server\80\data\master.mdf') then
  237. masterpath='e:\Program Files\Microsoft SQL Server\data\'
  238. goto ext
  239. end if
  240. IF FILEEXISTs('e:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') then
  241. masterpath='e:\Program Files\Microsoft SQL Server\MSSQL\data\'
  242. goto ext
  243. end if
  244. IF FILEEXISTs('f:\mssql7\data\master.mdf') then
  245. masterpath='f:\mssql7\data\'
  246. goto ext
  247. end if
  248. IF FILEEXISTs('f:\Program Files\Microsoft SQL Server\80\data\master.mdf') then
  249. masterpath='f:\Program Files\Microsoft SQL Server\data\'
  250. goto ext
  251. end if
  252. IF FILEEXISTs('f:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') then
  253. masterpath='f:\Program Files\Microsoft SQL Server\MSSQL\data\'
  254. goto ext
  255. end if
  256. IF FILEEXISTs('g:\mssql7\data\master.mdf') then
  257. masterpath='g:\mssql7\data\'
  258. goto ext
  259. end if
  260. IF FILEEXISTs('g:\Program Files\Microsoft SQL Server\80\data\master.mdf') then
  261. masterpath='g:\Program Files\Microsoft SQL Server\data\'
  262. goto ext
  263. end if
  264. IF FILEEXISTs('g:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') then
  265. masterpath='g:\Program Files\Microsoft SQL Server\MSSQL\data\'
  266. goto ext
  267. end if
  268. IF FILEEXISTs('h:\mssql7\data\master.mdf') then
  269. masterpath='h:\mssql7\data\'
  270. goto ext
  271. end if
  272. IF FILEEXISTs('h:\Program Files\Microsoft SQL Server\80\data\master.mdf') then
  273. masterpath='h:\Program Files\Microsoft SQL Server\data\'
  274. goto ext
  275. end if
  276. IF FILEEXISTs('h:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') then
  277. masterpath='h:\Program Files\Microsoft SQL Server\MSSQL\data\'
  278. goto ext
  279. end if
  280. ext:
  281. if masterpath='' then masterpath="c:\Program Files\Microsoft SQL Server\MSSQL\data\"
  282. wf_autobuiltmdflogname()
  283. return 0
  284. end function
  285. public subroutine wf_face_change ();IF ARROWADDNEW = 0 THEN
  286. This.Height = 740
  287. // sle_filename.Enabled = False
  288. // cb_ch2.Enabled = False
  289. // sle_sqldb_mdf.Enabled = False
  290. // cb_sqldb_mdf.Enabled = False
  291. // sle_sqldb_ldf.Enabled = False
  292. // cb_sqldb_ldf.Enabled = False
  293. //
  294. // cbx_db_h.Enabled = False
  295. //
  296. st_193.Visible = False
  297. rb_server.Visible = False
  298. rb_2.Visible = False
  299. cbx_addnewdatabase.Visible = False
  300. cb_ok.Y = 496
  301. cb_exit.Y = 496
  302. RETURN
  303. END IF
  304. IF cbx_addnewdatabase.Checked THEN //新建数据库
  305. sle_userid.Text = 'SA'
  306. sle_dbpass.Text = ''
  307. This.Height = 1600
  308. gb_1.visible = true
  309. st_8.visible = true
  310. sle_filename.visible = true
  311. cb_ch2.visible = true
  312. gb_1.visible = true
  313. st_8.visible = true
  314. sle_filename.visible = true
  315. cb_ch2.visible = true
  316. st_91.visible = true
  317. sle_sqldb_mdf.visible = true
  318. cb_sqldb_mdf.visible = true
  319. st_912.visible = true
  320. sle_sqldb_ldf.visible = true
  321. cb_sqldb_ldf.visible = true
  322. // gb_1.Y = 620
  323. // st_8.Y = 708
  324. // sle_filename.Y = 692
  325. // cb_ch2.Y = 692
  326. // st_91.Y = 800
  327. // sle_sqldb_mdf.Y = 784
  328. // cb_sqldb_mdf.Y = 784
  329. // st_912.Y = 892
  330. // sle_sqldb_ldf.Y = 876
  331. // cb_sqldb_ldf.Y = 876
  332. //
  333. // cbx_db_h.Y = 988
  334. // gb_3.Y = 988
  335. // st_2334.Y = 1060
  336. // sle_sqldb_mdf_sor.Y = 1044
  337. // st_345.Y = 1152
  338. // sle_sqldb_ldf_sor.Y = 1136
  339. cb_ok.Y = 1360
  340. cb_exit.Y = 1360
  341. ELSE
  342. This.Height = 860
  343. gb_1.visible = False
  344. st_8.visible = False
  345. sle_filename.visible = False
  346. cb_ch2.visible = False
  347. // st_91.visible = False
  348. // sle_sqldb_mdf.visible = False
  349. // cb_sqldb_mdf.visible = False
  350. // sle_sqldb_ldf.visible = False
  351. // cb_sqldb_ldf.visible = False
  352. cbx_db_h.Enabled = true
  353. st_193.Visible = true
  354. rb_server.Visible = true
  355. rb_2.Visible = true
  356. cbx_addnewdatabase.Visible = true
  357. cb_ok.Y = 616
  358. cb_exit.Y = 616
  359. END IF
  360. cbx_db_h.PostEvent(Clicked!)
  361. end subroutine
  362. event open;call super::open;// Open script for W_SET_SQLCA
  363. ARROWADDNEW = Message.DoubleParm
  364. IF ARROWADDNEW = 0 THEN
  365. cbx_addnewdatabase.Enabled = False
  366. END IF
  367. sle_dbms.Text = ProfileString (sys_inifilename, "database", "dbms", "")
  368. sle_database.Text = sys_Database
  369. sle_userid.Text = ProfileString (sys_inifilename, "database", "userid", "")
  370. sle_dbpass.Text = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbpass", ""),1,sys_power_key)
  371. sle_logid.Text = ProfileString (sys_inifilename, "database", "logid", "")
  372. sle_logpass.Text = f_psw_bczh(ProfileString (sys_inifilename, "database", "LogPassWord", ""),1,sys_power_key)
  373. sle_server.Text = ProfileString (sys_inifilename, "database", "servername", "")
  374. sle_dbparm.Text = f_psw_bczh(ProfileString (sys_inifilename, "database", "dbparm", ""),1,sys_power_key)
  375. sle_bookname.Text = sys_bookname
  376. sle_sqldb_mdf_sor.Text = ProfileString (sys_inifilename, "database", "sqldb_mdf_sor", '')
  377. sle_sqldb_ldf_sor.Text = ProfileString (sys_inifilename, "database", "sqldb_ldf_sor",'' )
  378. IF Trim(ProfileString(sys_inifilename,'SERVER','SERVER','')) = '' THEN
  379. rb_2.Checked = True //客户机模式
  380. ELSE
  381. rb_server.Checked = True //服务器模式
  382. END IF
  383. rb_server.PostEvent(Clicked!)
  384. cbx_addnewdatabase.TriggerEvent(Clicked!)
  385. wf_findisql()
  386. end event
  387. on w_set_sqlca.create
  388. int iCurrent
  389. call super::create
  390. this.cb_ok=create cb_ok
  391. this.sle_logpass=create sle_logpass
  392. this.sle_logid=create sle_logid
  393. this.sle_server=create sle_server
  394. this.sle_database=create sle_database
  395. this.sle_dbpass=create sle_dbpass
  396. this.sle_userid=create sle_userid
  397. this.sle_dbparm=create sle_dbparm
  398. this.st_9=create st_9
  399. this.st_6=create st_6
  400. this.st_5=create st_5
  401. this.st_4=create st_4
  402. this.st_3=create st_3
  403. this.st_2=create st_2
  404. this.st_00=create st_00
  405. this.st_7=create st_7
  406. this.cb_ch2=create cb_ch2
  407. this.sle_filename=create sle_filename
  408. this.cbx_addnewdatabase=create cbx_addnewdatabase
  409. this.rb_server=create rb_server
  410. this.rb_2=create rb_2
  411. this.sle_dbms=create sle_dbms
  412. this.st_8=create st_8
  413. this.sle_sqldb_mdf=create sle_sqldb_mdf
  414. this.sle_sqldb_ldf=create sle_sqldb_ldf
  415. this.st_91=create st_91
  416. this.st_912=create st_912
  417. this.cb_sqldb_mdf=create cb_sqldb_mdf
  418. this.cb_sqldb_ldf=create cb_sqldb_ldf
  419. this.gb_1=create gb_1
  420. this.st_193=create st_193
  421. this.st_2334=create st_2334
  422. this.st_345=create st_345
  423. this.sle_sqldb_mdf_sor=create sle_sqldb_mdf_sor
  424. this.sle_sqldb_ldf_sor=create sle_sqldb_ldf_sor
  425. this.cbx_db_h=create cbx_db_h
  426. this.gb_3=create gb_3
  427. this.st_jd=create st_jd
  428. this.st_1=create st_1
  429. this.sle_bookname=create sle_bookname
  430. iCurrent=UpperBound(this.Control)
  431. this.Control[iCurrent+1]=this.cb_ok
  432. this.Control[iCurrent+2]=this.sle_logpass
  433. this.Control[iCurrent+3]=this.sle_logid
  434. this.Control[iCurrent+4]=this.sle_server
  435. this.Control[iCurrent+5]=this.sle_database
  436. this.Control[iCurrent+6]=this.sle_dbpass
  437. this.Control[iCurrent+7]=this.sle_userid
  438. this.Control[iCurrent+8]=this.sle_dbparm
  439. this.Control[iCurrent+9]=this.st_9
  440. this.Control[iCurrent+10]=this.st_6
  441. this.Control[iCurrent+11]=this.st_5
  442. this.Control[iCurrent+12]=this.st_4
  443. this.Control[iCurrent+13]=this.st_3
  444. this.Control[iCurrent+14]=this.st_2
  445. this.Control[iCurrent+15]=this.st_00
  446. this.Control[iCurrent+16]=this.st_7
  447. this.Control[iCurrent+17]=this.cb_ch2
  448. this.Control[iCurrent+18]=this.sle_filename
  449. this.Control[iCurrent+19]=this.cbx_addnewdatabase
  450. this.Control[iCurrent+20]=this.rb_server
  451. this.Control[iCurrent+21]=this.rb_2
  452. this.Control[iCurrent+22]=this.sle_dbms
  453. this.Control[iCurrent+23]=this.st_8
  454. this.Control[iCurrent+24]=this.sle_sqldb_mdf
  455. this.Control[iCurrent+25]=this.sle_sqldb_ldf
  456. this.Control[iCurrent+26]=this.st_91
  457. this.Control[iCurrent+27]=this.st_912
  458. this.Control[iCurrent+28]=this.cb_sqldb_mdf
  459. this.Control[iCurrent+29]=this.cb_sqldb_ldf
  460. this.Control[iCurrent+30]=this.gb_1
  461. this.Control[iCurrent+31]=this.st_193
  462. this.Control[iCurrent+32]=this.st_2334
  463. this.Control[iCurrent+33]=this.st_345
  464. this.Control[iCurrent+34]=this.sle_sqldb_mdf_sor
  465. this.Control[iCurrent+35]=this.sle_sqldb_ldf_sor
  466. this.Control[iCurrent+36]=this.cbx_db_h
  467. this.Control[iCurrent+37]=this.gb_3
  468. this.Control[iCurrent+38]=this.st_jd
  469. this.Control[iCurrent+39]=this.st_1
  470. this.Control[iCurrent+40]=this.sle_bookname
  471. end on
  472. on w_set_sqlca.destroy
  473. call super::destroy
  474. destroy(this.cb_ok)
  475. destroy(this.sle_logpass)
  476. destroy(this.sle_logid)
  477. destroy(this.sle_server)
  478. destroy(this.sle_database)
  479. destroy(this.sle_dbpass)
  480. destroy(this.sle_userid)
  481. destroy(this.sle_dbparm)
  482. destroy(this.st_9)
  483. destroy(this.st_6)
  484. destroy(this.st_5)
  485. destroy(this.st_4)
  486. destroy(this.st_3)
  487. destroy(this.st_2)
  488. destroy(this.st_00)
  489. destroy(this.st_7)
  490. destroy(this.cb_ch2)
  491. destroy(this.sle_filename)
  492. destroy(this.cbx_addnewdatabase)
  493. destroy(this.rb_server)
  494. destroy(this.rb_2)
  495. destroy(this.sle_dbms)
  496. destroy(this.st_8)
  497. destroy(this.sle_sqldb_mdf)
  498. destroy(this.sle_sqldb_ldf)
  499. destroy(this.st_91)
  500. destroy(this.st_912)
  501. destroy(this.cb_sqldb_mdf)
  502. destroy(this.cb_sqldb_ldf)
  503. destroy(this.gb_1)
  504. destroy(this.st_193)
  505. destroy(this.st_2334)
  506. destroy(this.st_345)
  507. destroy(this.sle_sqldb_mdf_sor)
  508. destroy(this.sle_sqldb_ldf_sor)
  509. destroy(this.cbx_db_h)
  510. destroy(this.gb_3)
  511. destroy(this.st_jd)
  512. destroy(this.st_1)
  513. destroy(this.sle_bookname)
  514. end on
  515. type cb_func from w_publ_base`cb_func within w_set_sqlca
  516. boolean visible = false
  517. integer x = 1934
  518. integer y = 644
  519. integer taborder = 40
  520. boolean enabled = false
  521. end type
  522. type cb_exit from w_publ_base`cb_exit within w_set_sqlca
  523. integer x = 1344
  524. integer y = 1360
  525. integer width = 315
  526. integer taborder = 200
  527. string text = "取消"
  528. end type
  529. type cb_ok from uo_imflatbutton within w_set_sqlca
  530. integer x = 704
  531. integer y = 1360
  532. integer width = 315
  533. integer height = 96
  534. integer taborder = 190
  535. end type
  536. event clicked;call super::clicked;IF rb_server.Checked THEN
  537. SetProfileString(sys_inifilename,'SERVER','SERVER','服务器模式')
  538. ELSE
  539. SetProfileString(sys_inifilename,'SERVER','SERVER',' ')
  540. END IF
  541. String ls_str
  542. ls_str = ProfileString(sys_inifilename,'SERVER','SERVER','')
  543. IF cbx_addnewdatabase.Checked THEN
  544. IF NOT FileExists(sle_filename.Text) THEN
  545. MessageBox("操作错误","指定恢复数据文件不存在",stopsign!)
  546. RETURN
  547. END IF
  548. // if messagebox("警告!","如果数据库已经存在,此操作可能将使当前数据库被覆盖,是否进行操作?",exclamation!,OKCancel!,2)=2 then
  549. // RETURN
  550. // end if
  551. IF Trim(sle_sqldb_mdf.Text) = '' OR Trim(sle_sqldb_ldf.Text) = '' THEN
  552. wf_autobuiltmdflogname()
  553. ELSE
  554. IF Pos(sle_sqldb_mdf.Text,':') = 0 OR Lower(Right(sle_sqldb_mdf.Text,4)) <> '.mdf' THEN
  555. MessageBox('','目标数据库文件名称错误!')
  556. RETURN
  557. END IF
  558. IF Pos(sle_sqldb_ldf.Text,':') = 0 OR Lower(Right(sle_sqldb_ldf.Text,4)) <> '.ldf' THEN
  559. MessageBox('','目标日志文件名称错误!')
  560. RETURN
  561. END IF
  562. END IF
  563. END IF
  564. IF Trim(sle_database.Text) = '' THEN
  565. MessageBox('系统提示','请输入database!')
  566. RETURN
  567. END IF
  568. IF Trim(sle_server.Text) = '' THEN
  569. MessageBox('系统提示','请输入server name!')
  570. RETURN
  571. END IF
  572. //sys_bookno
  573. string ls_ini_book
  574. ls_ini_book = f_psw_bczh(ProfileString (sys_inifilename_other,'sys_dl_book', String(sys_bookno), ''),1,sys_power_key)
  575. ls_ini_book = Replace(ls_ini_book,pos(ls_ini_book,sys_database),len(sys_database),sle_database.Text)
  576. SetProfileString(sys_inifilename_other,'sys_dl_book', String(sys_bookno), f_psw_bczh(ls_ini_book,0,sys_power_key))
  577. SetProfileString (sys_inifilename, "database", "dbms", sle_dbms.Text)
  578. //SetProfileString (sys_inifilename, "database", "database", sle_database.Text)
  579. SetProfileString (sys_inifilename, "database", "userid", sle_userid.Text)
  580. SetProfileString (sys_inifilename, "database", "dbpass", f_psw_bczh(sle_dbpass.Text,0,sys_power_key))
  581. SetProfileString (sys_inifilename, "database", "logid", sle_logid.Text)
  582. SetProfileString (sys_inifilename, "database", "LogPassWord", f_psw_bczh(sle_logpass.Text,0,sys_power_key))
  583. SetProfileString (sys_inifilename, "database", "servername", sle_server.Text)
  584. SetProfileString (sys_inifilename, "database", "dbparm", f_psw_bczh(sle_dbparm.Text,0,sys_power_key))
  585. IF cbx_addnewdatabase.Checked THEN
  586. IF cbx_db_h.Checked THEN
  587. SetProfileString (sys_inifilename, "database", "sqldb_mdf_sor", sle_sqldb_mdf_sor.Text)
  588. SetProfileString (sys_inifilename, "database", "sqldb_ldf_sor", sle_sqldb_ldf_sor.Text)
  589. END IF
  590. IF wf_buildsqldb() = 0 THEN
  591. MessageBox("系统提示","生成数据库操作失败!")
  592. RETURN
  593. END IF
  594. END IF
  595. MessageBox('','设置保存完成!系统必须重起!')
  596. CloseWithReturn (PARENT,1)
  597. Restart()
  598. end event
  599. type sle_logpass from singlelineedit within w_set_sqlca
  600. integer x = 443
  601. integer y = 284
  602. integer width = 1655
  603. integer height = 80
  604. integer taborder = 60
  605. integer textsize = -8
  606. integer weight = 400
  607. fontpitch fontpitch = variable!
  608. fontfamily fontfamily = swiss!
  609. string facename = "MS Sans Serif"
  610. long textcolor = 41943040
  611. boolean autohscroll = false
  612. boolean password = true
  613. borderstyle borderstyle = stylelowered!
  614. end type
  615. type sle_logid from singlelineedit within w_set_sqlca
  616. integer x = 443
  617. integer y = 196
  618. integer width = 1655
  619. integer height = 80
  620. integer taborder = 50
  621. integer textsize = -8
  622. integer weight = 400
  623. fontpitch fontpitch = variable!
  624. fontfamily fontfamily = swiss!
  625. string facename = "MS Sans Serif"
  626. long textcolor = 41943040
  627. boolean autohscroll = false
  628. borderstyle borderstyle = stylelowered!
  629. end type
  630. type sle_server from singlelineedit within w_set_sqlca
  631. integer x = 443
  632. integer y = 108
  633. integer width = 1655
  634. integer height = 80
  635. integer taborder = 20
  636. integer textsize = -8
  637. integer weight = 400
  638. fontpitch fontpitch = variable!
  639. fontfamily fontfamily = swiss!
  640. string facename = "MS Sans Serif"
  641. long textcolor = 41943040
  642. boolean autohscroll = false
  643. borderstyle borderstyle = stylelowered!
  644. end type
  645. type sle_database from singlelineedit within w_set_sqlca
  646. integer x = 443
  647. integer y = 372
  648. integer width = 1655
  649. integer height = 80
  650. integer taborder = 80
  651. integer textsize = -8
  652. integer weight = 400
  653. fontpitch fontpitch = variable!
  654. fontfamily fontfamily = swiss!
  655. string facename = "MS Sans Serif"
  656. long textcolor = 41943040
  657. boolean autohscroll = false
  658. borderstyle borderstyle = stylelowered!
  659. end type
  660. event modified;wf_autobuiltmdflogname()
  661. end event
  662. type sle_dbpass from singlelineedit within w_set_sqlca
  663. boolean visible = false
  664. integer x = 443
  665. integer y = 204
  666. integer width = 1422
  667. integer height = 80
  668. integer taborder = 70
  669. integer textsize = -8
  670. integer weight = 400
  671. fontpitch fontpitch = variable!
  672. fontfamily fontfamily = swiss!
  673. string facename = "MS Sans Serif"
  674. long textcolor = 41943040
  675. boolean enabled = false
  676. boolean autohscroll = false
  677. boolean password = true
  678. borderstyle borderstyle = stylelowered!
  679. end type
  680. type sle_userid from singlelineedit within w_set_sqlca
  681. boolean visible = false
  682. integer x = 443
  683. integer y = 116
  684. integer width = 1422
  685. integer height = 80
  686. integer taborder = 30
  687. integer textsize = -8
  688. integer weight = 400
  689. fontcharset fontcharset = ansi!
  690. fontpitch fontpitch = variable!
  691. fontfamily fontfamily = swiss!
  692. string facename = "MS Sans Serif"
  693. long textcolor = 41943040
  694. boolean enabled = false
  695. boolean autohscroll = false
  696. borderstyle borderstyle = stylelowered!
  697. end type
  698. type sle_dbparm from singlelineedit within w_set_sqlca
  699. boolean visible = false
  700. integer x = 443
  701. integer y = 644
  702. integer width = 1422
  703. integer height = 80
  704. integer taborder = 210
  705. integer textsize = -8
  706. integer weight = 400
  707. fontpitch fontpitch = variable!
  708. fontfamily fontfamily = swiss!
  709. string facename = "MS Sans Serif"
  710. long textcolor = 41943040
  711. borderstyle borderstyle = stylelowered!
  712. end type
  713. type st_9 from statictext within w_set_sqlca
  714. boolean visible = false
  715. integer x = 192
  716. integer y = 656
  717. integer width = 233
  718. integer height = 60
  719. integer textsize = -8
  720. integer weight = 400
  721. fontpitch fontpitch = variable!
  722. fontfamily fontfamily = swiss!
  723. string facename = "MS Sans Serif"
  724. long textcolor = 41943040
  725. long backcolor = 74481808
  726. boolean enabled = false
  727. string text = "DBPARM:"
  728. alignment alignment = right!
  729. boolean focusrectangle = false
  730. end type
  731. type st_6 from statictext within w_set_sqlca
  732. integer x = 18
  733. integer y = 284
  734. integer width = 407
  735. integer height = 60
  736. integer textsize = -8
  737. integer weight = 400
  738. fontpitch fontpitch = variable!
  739. fontfamily fontfamily = swiss!
  740. string facename = "MS Sans Serif"
  741. long textcolor = 41943040
  742. long backcolor = 134217739
  743. boolean enabled = false
  744. string text = "登录 口令:"
  745. alignment alignment = right!
  746. boolean focusrectangle = false
  747. end type
  748. type st_5 from statictext within w_set_sqlca
  749. integer x = 18
  750. integer y = 200
  751. integer width = 407
  752. integer height = 60
  753. integer textsize = -8
  754. integer weight = 400
  755. fontpitch fontpitch = variable!
  756. fontfamily fontfamily = swiss!
  757. string facename = "MS Sans Serif"
  758. long textcolor = 41943040
  759. long backcolor = 134217739
  760. boolean enabled = false
  761. string text = "登录 ID:"
  762. alignment alignment = right!
  763. boolean focusrectangle = false
  764. end type
  765. type st_4 from statictext within w_set_sqlca
  766. boolean visible = false
  767. integer x = 151
  768. integer y = 216
  769. integer width = 274
  770. integer height = 60
  771. integer textsize = -8
  772. integer weight = 400
  773. fontpitch fontpitch = variable!
  774. fontfamily fontfamily = swiss!
  775. string facename = "MS Sans Serif"
  776. long textcolor = 41943040
  777. long backcolor = 134217739
  778. boolean enabled = false
  779. string text = "口令:"
  780. alignment alignment = right!
  781. boolean focusrectangle = false
  782. end type
  783. type st_3 from statictext within w_set_sqlca
  784. boolean visible = false
  785. integer x = 187
  786. integer y = 128
  787. integer width = 238
  788. integer height = 60
  789. integer textsize = -8
  790. integer weight = 400
  791. fontpitch fontpitch = variable!
  792. fontfamily fontfamily = swiss!
  793. string facename = "MS Sans Serif"
  794. long textcolor = 41943040
  795. long backcolor = 134217739
  796. boolean enabled = false
  797. string text = "用户ID:"
  798. alignment alignment = right!
  799. boolean focusrectangle = false
  800. end type
  801. type st_2 from statictext within w_set_sqlca
  802. integer x = 18
  803. integer y = 368
  804. integer width = 407
  805. integer height = 60
  806. integer textsize = -8
  807. integer weight = 400
  808. fontpitch fontpitch = variable!
  809. fontfamily fontfamily = swiss!
  810. string facename = "MS Sans Serif"
  811. long textcolor = 41943040
  812. long backcolor = 134217739
  813. boolean enabled = false
  814. string text = "数据库:"
  815. alignment alignment = right!
  816. boolean focusrectangle = false
  817. end type
  818. type st_00 from statictext within w_set_sqlca
  819. boolean visible = false
  820. integer x = 82
  821. integer y = 40
  822. integer width = 343
  823. integer height = 60
  824. integer textsize = -8
  825. integer weight = 400
  826. fontpitch fontpitch = variable!
  827. fontfamily fontfamily = swiss!
  828. string facename = "MS Sans Serif"
  829. long backcolor = 134217739
  830. boolean enabled = false
  831. string text = "DBMS:"
  832. alignment alignment = right!
  833. boolean focusrectangle = false
  834. end type
  835. type st_7 from statictext within w_set_sqlca
  836. integer x = 18
  837. integer y = 116
  838. integer width = 407
  839. integer height = 60
  840. integer textsize = -8
  841. integer weight = 400
  842. fontpitch fontpitch = variable!
  843. fontfamily fontfamily = swiss!
  844. string facename = "MS Sans Serif"
  845. long textcolor = 41943040
  846. long backcolor = 134217739
  847. boolean enabled = false
  848. string text = "服务器:"
  849. alignment alignment = right!
  850. boolean focusrectangle = false
  851. end type
  852. type cb_ch2 from commandbutton within w_set_sqlca
  853. integer x = 2112
  854. integer y = 692
  855. integer width = 114
  856. integer height = 84
  857. integer taborder = 110
  858. integer textsize = -9
  859. integer weight = 400
  860. fontcharset fontcharset = gb2312charset!
  861. fontpitch fontpitch = variable!
  862. string facename = "宋体"
  863. string text = "..."
  864. end type
  865. event clicked;
  866. integer i
  867. string pathname,filename
  868. i=getfilesavename("选择备份文件",pathname,filename,"Dat","数据文件Dat,*.Dat")
  869. IF i=1 AND TRIM(pathname)<>'' AND TRIM(FILENAME)<>"" THEN
  870. sle_filename.text=pathname
  871. END IF
  872. end event
  873. type sle_filename from singlelineedit within w_set_sqlca
  874. integer x = 457
  875. integer y = 692
  876. integer width = 1655
  877. integer height = 80
  878. integer taborder = 100
  879. integer textsize = -9
  880. integer weight = 400
  881. fontcharset fontcharset = gb2312charset!
  882. fontpitch fontpitch = variable!
  883. string facename = "宋体"
  884. long textcolor = 33554432
  885. borderstyle borderstyle = stylelowered!
  886. end type
  887. type cbx_addnewdatabase from checkbox within w_set_sqlca
  888. integer x = 1353
  889. integer y = 496
  890. integer width = 503
  891. integer height = 72
  892. integer taborder = 90
  893. integer textsize = -9
  894. integer weight = 400
  895. fontcharset fontcharset = gb2312charset!
  896. fontpitch fontpitch = variable!
  897. string facename = "宋体"
  898. long textcolor = 255
  899. long backcolor = 134217739
  900. boolean enabled = false
  901. string text = "自动新建数据库"
  902. end type
  903. event clicked;wf_face_change()
  904. //IF This.Checked THEN //新建数据库
  905. // sle_userid.Text = 'SA'
  906. // sle_dbpass.Text = ''
  907. //
  908. // Parent.Height = 1600
  909. // sle_filename.Enabled = True
  910. // cb_ch2.Enabled = True
  911. // sle_sqldb_mdf.Enabled = True
  912. // cb_sqldb_mdf.Enabled = True
  913. // sle_sqldb_ldf.Enabled = True
  914. // cb_sqldb_ldf.Enabled = True
  915. //
  916. // cbx_db_h.Enabled = True
  917. //
  918. // st_193.Visible = True
  919. // rb_server.Visible = True
  920. // rb_2.Visible = True
  921. // cbx_addnewdatabase.Visible = True
  922. //
  923. // cb_ok.Y = 1360
  924. // cb_exit.Y = 1360
  925. //ELSE
  926. // Parent.Height = 740
  927. // sle_filename.Enabled = False
  928. // cb_ch2.Enabled = False
  929. // sle_sqldb_mdf.Enabled = False
  930. // cb_sqldb_mdf.Enabled = False
  931. // sle_sqldb_ldf.Enabled = False
  932. // cb_sqldb_ldf.Enabled = False
  933. //
  934. // cbx_db_h.Enabled = False
  935. //
  936. // st_193.Visible = False
  937. // rb_server.Visible = False
  938. // rb_2.Visible = False
  939. // cbx_addnewdatabase.Visible = False
  940. //
  941. // cb_ok.Y = 496
  942. // cb_exit.Y = 496
  943. //END IF
  944. //
  945. //cbx_db_h.PostEvent(Clicked!)
  946. //
  947. //
  948. end event
  949. type rb_server from radiobutton within w_set_sqlca
  950. integer x = 457
  951. integer y = 496
  952. integer width = 357
  953. integer height = 76
  954. boolean bringtotop = true
  955. integer textsize = -9
  956. integer weight = 400
  957. fontcharset fontcharset = gb2312charset!
  958. fontpitch fontpitch = variable!
  959. string facename = "宋体"
  960. long textcolor = 33554432
  961. long backcolor = 134217739
  962. string text = "服务器模式"
  963. end type
  964. event clicked;
  965. sle_dbms.triggerevent(selectionchanged!)
  966. end event
  967. type rb_2 from radiobutton within w_set_sqlca
  968. integer x = 850
  969. integer y = 496
  970. integer width = 357
  971. integer height = 76
  972. boolean bringtotop = true
  973. integer textsize = -9
  974. integer weight = 400
  975. fontcharset fontcharset = gb2312charset!
  976. fontpitch fontpitch = variable!
  977. string facename = "宋体"
  978. long textcolor = 33554432
  979. long backcolor = 134217739
  980. string text = "客户机模式"
  981. end type
  982. event clicked;
  983. sle_dbms.postevent(selectionchanged!)
  984. end event
  985. type sle_dbms from dropdownlistbox within w_set_sqlca
  986. boolean visible = false
  987. integer x = 443
  988. integer y = 28
  989. integer width = 1422
  990. integer height = 156
  991. integer taborder = 240
  992. boolean bringtotop = true
  993. integer textsize = -8
  994. integer weight = 400
  995. fontcharset fontcharset = ansi!
  996. fontpitch fontpitch = variable!
  997. fontfamily fontfamily = swiss!
  998. string facename = "MS Sans Serif"
  999. long textcolor = 33554432
  1000. boolean allowedit = true
  1001. boolean sorted = false
  1002. boolean vscrollbar = true
  1003. string item[] = {"ODBC","MSS Microsoft SQL Server 6.x"}
  1004. borderstyle borderstyle = stylelowered!
  1005. end type
  1006. event selectionchanged;cbx_addnewdatabase.Enabled = (ARROWADDNEW <> 0 And rb_server.Checked And sle_dbms.Text = 'MSS Microsoft SQL Server 6.x')
  1007. IF Not rb_server.Checked THEN cbx_addnewdatabase.Checked = False
  1008. IF Not cbx_addnewdatabase.Checked THEN cbx_addnewdatabase.TriggerEvent(Clicked!)
  1009. wf_findisql()
  1010. end event
  1011. event modified;sle_dbms.postevent(selectionchanged!)
  1012. end event
  1013. type st_8 from statictext within w_set_sqlca
  1014. integer x = 87
  1015. integer y = 708
  1016. integer width = 370
  1017. integer height = 48
  1018. boolean bringtotop = true
  1019. integer textsize = -9
  1020. integer weight = 400
  1021. fontcharset fontcharset = gb2312charset!
  1022. fontpitch fontpitch = variable!
  1023. string facename = "宋体"
  1024. long textcolor = 33554432
  1025. long backcolor = 134217739
  1026. boolean enabled = false
  1027. string text = "空数据库来自:"
  1028. alignment alignment = right!
  1029. boolean focusrectangle = false
  1030. end type
  1031. type sle_sqldb_mdf from singlelineedit within w_set_sqlca
  1032. integer x = 457
  1033. integer y = 784
  1034. integer width = 1655
  1035. integer height = 80
  1036. integer taborder = 120
  1037. integer textsize = -9
  1038. integer weight = 400
  1039. fontcharset fontcharset = gb2312charset!
  1040. fontpitch fontpitch = variable!
  1041. string facename = "宋体"
  1042. long textcolor = 33554432
  1043. borderstyle borderstyle = stylelowered!
  1044. end type
  1045. type sle_sqldb_ldf from singlelineedit within w_set_sqlca
  1046. integer x = 457
  1047. integer y = 876
  1048. integer width = 1655
  1049. integer height = 80
  1050. integer taborder = 140
  1051. integer textsize = -9
  1052. integer weight = 400
  1053. fontcharset fontcharset = gb2312charset!
  1054. fontpitch fontpitch = variable!
  1055. string facename = "宋体"
  1056. long textcolor = 33554432
  1057. borderstyle borderstyle = stylelowered!
  1058. end type
  1059. type st_91 from statictext within w_set_sqlca
  1060. integer x = 87
  1061. integer y = 800
  1062. integer width = 370
  1063. integer height = 48
  1064. boolean bringtotop = true
  1065. integer textsize = -9
  1066. integer weight = 400
  1067. fontcharset fontcharset = gb2312charset!
  1068. fontpitch fontpitch = variable!
  1069. string facename = "宋体"
  1070. long textcolor = 33554432
  1071. long backcolor = 134217739
  1072. boolean enabled = false
  1073. string text = "目标数据文件:"
  1074. alignment alignment = right!
  1075. boolean focusrectangle = false
  1076. end type
  1077. type st_912 from statictext within w_set_sqlca
  1078. integer x = 87
  1079. integer y = 892
  1080. integer width = 370
  1081. integer height = 48
  1082. boolean bringtotop = true
  1083. integer textsize = -9
  1084. integer weight = 400
  1085. fontcharset fontcharset = gb2312charset!
  1086. fontpitch fontpitch = variable!
  1087. string facename = "宋体"
  1088. long textcolor = 33554432
  1089. long backcolor = 134217739
  1090. boolean enabled = false
  1091. string text = "目标日志文件:"
  1092. alignment alignment = right!
  1093. boolean focusrectangle = false
  1094. end type
  1095. type cb_sqldb_mdf from commandbutton within w_set_sqlca
  1096. integer x = 2112
  1097. integer y = 784
  1098. integer width = 114
  1099. integer height = 84
  1100. integer taborder = 130
  1101. integer textsize = -9
  1102. integer weight = 400
  1103. fontcharset fontcharset = gb2312charset!
  1104. fontpitch fontpitch = variable!
  1105. string facename = "宋体"
  1106. string text = "..."
  1107. end type
  1108. event clicked;integer i
  1109. string pathname,filename
  1110. i=getfilesavename("数据文件及路径",pathname,filename,"MDF","MDF,*.MDF")
  1111. IF i=1 AND TRIM(pathname)<>'' AND TRIM(FILENAME)<>"" THEN
  1112. IF RIGHT(LOWER(pathname),4)<>'.mdf' THEN
  1113. MESSAGEBOX('','请输入MDF文件!')
  1114. return
  1115. END IF
  1116. sle_sqldb_mdf.text=pathname
  1117. END IF
  1118. end event
  1119. type cb_sqldb_ldf from commandbutton within w_set_sqlca
  1120. integer x = 2112
  1121. integer y = 876
  1122. integer width = 114
  1123. integer height = 84
  1124. integer taborder = 150
  1125. integer textsize = -9
  1126. integer weight = 400
  1127. fontcharset fontcharset = gb2312charset!
  1128. fontpitch fontpitch = variable!
  1129. string facename = "宋体"
  1130. string text = "..."
  1131. end type
  1132. event clicked;integer i
  1133. string pathname,filename
  1134. i=getfilesavename("数据日志文件及路径",pathname,filename,"ldf","MS SQL Server日志ldf,*.ldf")
  1135. IF i=1 AND TRIM(pathname)<>'' AND TRIM(FILENAME)<>"" THEN
  1136. IF RIGHT(LOWER(pathname),4)<>'.ldf' THEN
  1137. MESSAGEBOX('','请输入ldf文件!')
  1138. return
  1139. END IF
  1140. sle_sqldb_ldf.text=pathname
  1141. END IF
  1142. end event
  1143. type gb_1 from groupbox within w_set_sqlca
  1144. integer x = 64
  1145. integer y = 620
  1146. integer width = 2194
  1147. integer height = 364
  1148. integer taborder = 230
  1149. integer textsize = -9
  1150. integer weight = 400
  1151. fontcharset fontcharset = gb2312charset!
  1152. fontpitch fontpitch = variable!
  1153. string facename = "宋体"
  1154. long textcolor = 33554432
  1155. long backcolor = 134217739
  1156. string text = "自动新建数据库"
  1157. end type
  1158. type st_193 from statictext within w_set_sqlca
  1159. integer x = 142
  1160. integer y = 508
  1161. integer width = 293
  1162. integer height = 48
  1163. integer textsize = -9
  1164. integer weight = 400
  1165. fontcharset fontcharset = gb2312charset!
  1166. fontpitch fontpitch = variable!
  1167. string facename = "宋体"
  1168. long textcolor = 41943040
  1169. long backcolor = 134217739
  1170. boolean enabled = false
  1171. string text = "工作模式:"
  1172. alignment alignment = right!
  1173. boolean focusrectangle = false
  1174. end type
  1175. type st_2334 from statictext within w_set_sqlca
  1176. integer x = 87
  1177. integer y = 1060
  1178. integer width = 370
  1179. integer height = 48
  1180. boolean bringtotop = true
  1181. integer textsize = -9
  1182. integer weight = 400
  1183. fontcharset fontcharset = gb2312charset!
  1184. fontpitch fontpitch = variable!
  1185. string facename = "宋体"
  1186. long textcolor = 33554432
  1187. long backcolor = 134217739
  1188. boolean enabled = false
  1189. string text = "源数据名称:"
  1190. alignment alignment = right!
  1191. boolean focusrectangle = false
  1192. end type
  1193. type st_345 from statictext within w_set_sqlca
  1194. integer x = 87
  1195. integer y = 1152
  1196. integer width = 370
  1197. integer height = 48
  1198. boolean bringtotop = true
  1199. integer textsize = -9
  1200. integer weight = 400
  1201. fontcharset fontcharset = gb2312charset!
  1202. fontpitch fontpitch = variable!
  1203. string facename = "宋体"
  1204. long textcolor = 33554432
  1205. long backcolor = 134217739
  1206. boolean enabled = false
  1207. string text = "源日志名称:"
  1208. alignment alignment = right!
  1209. boolean focusrectangle = false
  1210. end type
  1211. type sle_sqldb_mdf_sor from singlelineedit within w_set_sqlca
  1212. integer x = 457
  1213. integer y = 1044
  1214. integer width = 1655
  1215. integer height = 80
  1216. integer taborder = 170
  1217. integer textsize = -9
  1218. integer weight = 400
  1219. fontcharset fontcharset = gb2312charset!
  1220. fontpitch fontpitch = variable!
  1221. string facename = "宋体"
  1222. long textcolor = 33554432
  1223. boolean enabled = false
  1224. borderstyle borderstyle = stylelowered!
  1225. end type
  1226. type sle_sqldb_ldf_sor from singlelineedit within w_set_sqlca
  1227. integer x = 457
  1228. integer y = 1136
  1229. integer width = 1655
  1230. integer height = 80
  1231. integer taborder = 180
  1232. integer textsize = -9
  1233. integer weight = 400
  1234. fontcharset fontcharset = gb2312charset!
  1235. fontpitch fontpitch = variable!
  1236. string facename = "宋体"
  1237. long textcolor = 33554432
  1238. boolean enabled = false
  1239. borderstyle borderstyle = stylelowered!
  1240. end type
  1241. type cbx_db_h from checkbox within w_set_sqlca
  1242. integer x = 101
  1243. integer y = 988
  1244. integer width = 201
  1245. integer height = 60
  1246. integer taborder = 160
  1247. boolean bringtotop = true
  1248. integer textsize = -9
  1249. integer weight = 400
  1250. fontcharset fontcharset = gb2312charset!
  1251. fontpitch fontpitch = variable!
  1252. string facename = "宋体"
  1253. long textcolor = 33554432
  1254. long backcolor = 134217739
  1255. string text = "高级"
  1256. end type
  1257. event clicked;sle_sqldb_mdf_sor.enabled=this.checked
  1258. sle_sqldb_ldf_sor.enabled=this.checked
  1259. end event
  1260. type gb_3 from groupbox within w_set_sqlca
  1261. integer x = 64
  1262. integer y = 988
  1263. integer width = 2194
  1264. integer height = 268
  1265. integer taborder = 220
  1266. integer textsize = -9
  1267. integer weight = 400
  1268. fontcharset fontcharset = gb2312charset!
  1269. fontpitch fontpitch = variable!
  1270. string facename = "宋体"
  1271. long textcolor = 33554432
  1272. long backcolor = 134217739
  1273. end type
  1274. type st_jd from statictext within w_set_sqlca
  1275. integer x = 50
  1276. integer y = 1280
  1277. integer width = 2226
  1278. integer height = 56
  1279. boolean bringtotop = true
  1280. integer textsize = -9
  1281. integer weight = 400
  1282. fontcharset fontcharset = gb2312charset!
  1283. fontpitch fontpitch = variable!
  1284. string facename = "宋体"
  1285. long textcolor = 16711680
  1286. long backcolor = 134217739
  1287. boolean enabled = false
  1288. alignment alignment = right!
  1289. boolean focusrectangle = false
  1290. end type
  1291. type st_1 from statictext within w_set_sqlca
  1292. integer x = 18
  1293. integer y = 32
  1294. integer width = 407
  1295. integer height = 60
  1296. boolean bringtotop = true
  1297. integer textsize = -8
  1298. integer weight = 400
  1299. fontpitch fontpitch = variable!
  1300. fontfamily fontfamily = swiss!
  1301. string facename = "MS Sans Serif"
  1302. long textcolor = 41943040
  1303. long backcolor = 134217739
  1304. boolean enabled = false
  1305. string text = "帐套:"
  1306. alignment alignment = right!
  1307. boolean focusrectangle = false
  1308. end type
  1309. type sle_bookname from singlelineedit within w_set_sqlca
  1310. integer x = 443
  1311. integer y = 20
  1312. integer width = 1655
  1313. integer height = 80
  1314. integer taborder = 10
  1315. boolean bringtotop = true
  1316. integer textsize = -8
  1317. integer weight = 400
  1318. fontpitch fontpitch = variable!
  1319. fontfamily fontfamily = swiss!
  1320. string facename = "MS Sans Serif"
  1321. long textcolor = 41943040
  1322. boolean enabled = false
  1323. boolean autohscroll = false
  1324. borderstyle borderstyle = stylelowered!
  1325. end type
  1326. event modified;wf_autobuiltmdflogname()
  1327. end event