12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172 |
- $PBExportHeader$w_create_book.srw
- $PBExportComments$数据库连接窗口
- forward
- global type w_create_book from w_publ_base
- end type
- type cb_ok from uo_imflatbutton within w_create_book
- end type
- type cb_ch2 from commandbutton within w_create_book
- end type
- type sle_filename from singlelineedit within w_create_book
- end type
- type st_8 from statictext within w_create_book
- end type
- type gb_1 from groupbox within w_create_book
- end type
- type st_2334 from statictext within w_create_book
- end type
- type st_345 from statictext within w_create_book
- end type
- type sle_sqldb_mdf_sor from singlelineedit within w_create_book
- end type
- type sle_sqldb_ldf_sor from singlelineedit within w_create_book
- end type
- type cbx_db_h from checkbox within w_create_book
- end type
- type gb_3 from groupbox within w_create_book
- end type
- type st_jd from statictext within w_create_book
- end type
- type st_2 from statictext within w_create_book
- end type
- type sle_database from singlelineedit within w_create_book
- end type
- type sle_bookname from singlelineedit within w_create_book
- end type
- type st_1 from statictext within w_create_book
- end type
- type sle_code from singlelineedit within w_create_book
- end type
- type st_3 from statictext within w_create_book
- end type
- type cbx_ifuse from checkbox within w_create_book
- end type
- type st_13 from statictext within w_create_book
- end type
- type sle_folder from singlelineedit within w_create_book
- end type
- type cb_2 from commandbutton within w_create_book
- end type
- type sle_fj from singlelineedit within w_create_book
- end type
- type cb_fj from commandbutton within w_create_book
- end type
- type cbx_fj from checkbox within w_create_book
- end type
- type cbx_1 from checkbox within w_create_book
- end type
- type st_14 from statictext within w_create_book
- end type
- type sle_pbl from singlelineedit within w_create_book
- end type
- end forward
- global type w_create_book from w_publ_base
- integer x = 283
- integer y = 12
- integer width = 2331
- integer height = 1244
- string title = "新建帐套"
- boolean minbox = false
- windowtype windowtype = response!
- cb_ok cb_ok
- cb_ch2 cb_ch2
- sle_filename sle_filename
- st_8 st_8
- gb_1 gb_1
- st_2334 st_2334
- st_345 st_345
- sle_sqldb_mdf_sor sle_sqldb_mdf_sor
- sle_sqldb_ldf_sor sle_sqldb_ldf_sor
- cbx_db_h cbx_db_h
- gb_3 gb_3
- st_jd st_jd
- st_2 st_2
- sle_database sle_database
- sle_bookname sle_bookname
- st_1 st_1
- sle_code sle_code
- st_3 st_3
- cbx_ifuse cbx_ifuse
- st_13 st_13
- sle_folder sle_folder
- cb_2 cb_2
- sle_fj sle_fj
- cb_fj cb_fj
- cbx_fj cbx_fj
- cbx_1 cbx_1
- st_14 st_14
- sle_pbl sle_pbl
- end type
- global w_create_book w_create_book
- type prototypes
- Subroutine Sleep(ulong dwMilliseconds) LIBRARY "kernel32.dll"
- Function long ShellExecuteA (long hwnd, string lpOperation ,String lpFile, String lpParameters, String lpDirectory, Long nShowCmd) Library "shell32.dll" alias for "ShellExecuteA;Ansi"
- end prototypes
- type variables
- String ls_bat_filename = '_ls_cmd_run.bat'
- String ls_txt_filename = '_ls_cmd_rslt.txt'
- String masterpath
- s_outerconnection s_db
- end variables
- forward prototypes
- public function integer wf_findisql ()
- public function integer wf_buildsqldb (ref string arg_msg)
- public function integer wf_autopbl ()
- end prototypes
- public function integer wf_findisql ();
- IF FileExists('c:\mssql7\data\master.mdf') THEN
- masterpath = 'c:\mssql7\data\'
- GOTO ext
- END IF
- IF FileExists('c:\Program Files\Microsoft SQL Server\80\data\master.mdf') THEN
- masterpath = 'c:\Program Files\Microsoft SQL Server\data\'
- GOTO ext
- END IF
- IF FileExists('c:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') THEN
- masterpath = "c:\Program Files\Microsoft SQL Server\MSSQL\data\"
- GOTO ext
- END IF
- IF FileExists('d:\mssql7\data\master.mdf') THEN
- masterpath = 'd:\mssql7\data\'
- GOTO ext
- END IF
- IF FileExists('d:\Program Files\Microsoft SQL Server\80\data\master.mdf') THEN
- masterpath = 'd:\Program Files\Microsoft SQL Server\data\'
- GOTO ext
- END IF
- IF FileExists('d:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') THEN
- masterpath = 'd:\Program Files\Microsoft SQL Server\MSSQL\data\'
- GOTO ext
- END IF
- IF FileExists('e:\mssql7\data\master.mdf') THEN
- masterpath = 'e:\mssql7\data\'
- GOTO ext
- END IF
- IF FileExists('e:\Program Files\Microsoft SQL Server\80\data\master.mdf') THEN
- masterpath = 'e:\Program Files\Microsoft SQL Server\data\'
- GOTO ext
- END IF
- IF FileExists('e:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') THEN
- masterpath = 'e:\Program Files\Microsoft SQL Server\MSSQL\data\'
- GOTO ext
- END IF
- IF FileExists('f:\mssql7\data\master.mdf') THEN
- masterpath = 'f:\mssql7\data\'
- GOTO ext
- END IF
- IF FileExists('f:\Program Files\Microsoft SQL Server\80\data\master.mdf') THEN
- masterpath = 'f:\Program Files\Microsoft SQL Server\data\'
- GOTO ext
- END IF
- IF FileExists('f:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') THEN
- masterpath = 'f:\Program Files\Microsoft SQL Server\MSSQL\data\'
- GOTO ext
- END IF
- IF FileExists('g:\mssql7\data\master.mdf') THEN
- masterpath = 'g:\mssql7\data\'
- GOTO ext
- END IF
- IF FileExists('g:\Program Files\Microsoft SQL Server\80\data\master.mdf') THEN
- masterpath = 'g:\Program Files\Microsoft SQL Server\data\'
- GOTO ext
- END IF
- IF FileExists('g:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') THEN
- masterpath = 'g:\Program Files\Microsoft SQL Server\MSSQL\data\'
- GOTO ext
- END IF
- IF FileExists('h:\mssql7\data\master.mdf') THEN
- masterpath = 'h:\mssql7\data\'
- GOTO ext
- END IF
- IF FileExists('h:\Program Files\Microsoft SQL Server\80\data\master.mdf') THEN
- masterpath = 'h:\Program Files\Microsoft SQL Server\data\'
- GOTO ext
- END IF
- IF FileExists('h:\Program Files\Microsoft SQL Server\MSSQL\data\master.mdf') THEN
- masterpath = 'h:\Program Files\Microsoft SQL Server\MSSQL\data\'
- GOTO ext
- END IF
- IF FileExists('d:\Program Files\MSDE\MSSQL\data\master.mdf') THEN
- masterpath = 'd:\Program Files\MSDE\MSSQL\data\'
- GOTO ext
- END IF
- ext:
- IF masterpath = '' THEN masterpath = "c:\Program Files\Microsoft SQL Server\MSSQL\data\"
- sle_folder.text = sys_cur_path + 'database'
- RETURN 0
- end function
- public function integer wf_buildsqldb (ref string arg_msg);Integer li_FileNum,rslt = 1
- String comm,msg
- Long i,j,lu_return
- Transaction db_Transaction
- db_Transaction = CREATE Transaction
- Int ll_result
- ll_result = createdirectory(sle_folder.Text)
- comm = ' create DATABASE '+sle_database.Text+&
- " on(name='"+sle_sqldb_mdf_sor.Text+"',FILENAME= '"+sle_folder.Text + '\' + sle_database.Text+'_data.ldf'+"') log on (name='"+sle_sqldb_ldf_sor.Text+"',FILENAME= '"+sle_folder.Text + '\' + sle_database.Text+'_log.ldf'+"')"
- db_Transaction.DBMS = sqlca.DBMS
- db_Transaction.Database = 'master'
- db_Transaction.LogID = sqlca.LogID
- db_Transaction.LogPass = sqlca.LogPass
- db_Transaction.ServerName = sqlca.ServerName
- IF db_Transaction.Database = '' OR db_Transaction.ServerName = '' THEN
- arg_msg = "连接数据库失败!"
- rslt = 0
- GOTO ext
- END IF
- CONNECT USING db_Transaction;
- IF db_Transaction.SQLCode <> 0 THEN
- arg_msg = '连接master数据库失败,'+db_Transaction.SQLErrText
- rslt = 0
- GOTO ext
- END IF
- db_Transaction.AutoCommit = TRUE
- st_jd.Text = '正在新建数据库...'
- EXECUTE IMMEDIATE :comm USING db_Transaction;
- IF db_Transaction.SQLCode <> 0 THEN
- arg_msg = '建立失败,请手动建立及恢复数据库>'+db_Transaction.SQLErrText
- ROLLBACK USING db_Transaction;
- rslt = 0
- GOTO ext
- ELSE
- rslt = 1
- COMMIT USING db_Transaction;
- END IF
- st_jd.Text = '正在恢复数据库...'
- comm = 'RESTORE DATABASE '+sle_database.Text+" from DISK= '"+sle_filename.Text+"'"+&
- " WITH MOVE '"+sle_sqldb_mdf_sor.Text+"' TO '"+sle_folder.Text + '\' + sle_database.Text+'_data.ldf'+"',"+&
- " MOVE '"+sle_sqldb_ldf_sor.Text+"' TO '"+sle_folder.Text + '\' + sle_database.Text+'_log.ldf'+"',"+'REPLACE'
- EXECUTE IMMEDIATE :comm USING db_Transaction;
- IF db_Transaction.SQLCode <> 0 THEN
- arg_msg = '恢复失败,请手动恢复数据库>'+db_Transaction.SQLErrText
- ROLLBACK USING db_Transaction;
- rslt = 0
- GOTO ext
- ELSE
- rslt = 1
- COMMIT USING db_Transaction;
- END IF
- IF cbx_db_h.Checked AND cbx_fj.Checked THEN
-
- IF sle_fj.Text = '' THEN
- arg_msg = '请先选择附件数据库文件!'
- END IF
-
- String ls_fjname,ls_test
- ls_fjname = RightTrim(LeftTrim(sle_database.Text)) + '_fj'
- ls_test = "if exists(select 1 from master..sysdatabases where name='" + ls_fjname + "') raiserror('Database existed',18,1) else raiserror('Database not existed',18,1) "
- EXECUTE IMMEDIATE :ls_test USING db_Transaction;
- IF db_Transaction.SQLErrText = 'Database existed' THEN
- IF MessageBox ("询问","附件数据库已存在,是否确定要覆盖?",Question!,YesNo! ) = 2 THEN
- RETURN 1
- ELSE
- comm = " IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'" + ls_fjname + "') DROP DATABASE [" + ls_fjname + "]"
- EXECUTE IMMEDIATE :comm USING db_Transaction;
- IF db_Transaction.SQLCode <> 0 THEN
- arg_msg = '删除失败,请手动删除附件数据库>'+db_Transaction.SQLErrText
- ROLLBACK;
- rslt = 0
- GOTO ext
- ELSE
- rslt = 1
- COMMIT;
- END IF
-
- END IF
- END IF
-
- st_jd.Text = '正在新建附件数据库...'
- comm = " create DATABASE " + ls_fjname +&
- " on(name='" + ls_fjname + "_data',FILENAME= '"+sle_folder.Text + '\' + ls_fjname + ".MDF" +"') log on (name=' " + ls_fjname + "_log',FILENAME= '"+sle_folder.Text + '\' + ls_fjname + ".ldf"+"')"
- EXECUTE IMMEDIATE :comm USING db_Transaction;
- IF db_Transaction.SQLCode <> 0 THEN
- arg_msg = '建立失败,请手动建立及恢复附件数据库>'+db_Transaction.SQLErrText
- ROLLBACK;
- rslt = 0
- GOTO ext
- ELSE
- rslt = 1
- COMMIT;
- END IF
-
- st_jd.Text = '正在恢复附件数据库...'
- comm = "RESTORE DATABASE " + ls_fjname + " from DISK= '"+sle_fj.Text+"'"+&
- " WITH MOVE 'filemanage_Data' TO '"+sle_folder.Text + '\' + ls_fjname + ".MDF"+"',"+&
- " MOVE 'filemanage_Log' TO '"+sle_folder.Text + '\' + ls_fjname + ".ldf"+"',"+'REPLACE'
-
- EXECUTE IMMEDIATE :comm USING db_Transaction;
- IF db_Transaction.SQLCode <> 0 THEN
- arg_msg = '恢复失败,请手动附件恢复附数据库>'+db_Transaction.SQLErrText
- ROLLBACK;
- rslt = 0
- GOTO ext
- ELSE
- rslt = 1
- COMMIT;
- END IF
- END IF
- //自动添加打印格式库
- IF LeftTrim(RightTrim(sle_pbl.Text)) <> '' THEN
- String ls_pbl
- ls_pbl = sys_cur_path + LeftTrim(RightTrim(sle_pbl.Text))
- IF FileExists(ls_pbl) THEN
- IF MessageBox ("询问","格式库文件已存在,是否确定要覆盖?",Question!,YesNo! ) = 2 THEN
- GOTO buildpbl
- ELSE
- FileDelete(ls_pbl)
- IF LibraryCreate(ls_pbl) = -1 THEN
- rslt = -1
- arg_msg = '创建格式库文件失败,请手动创建'
- END IF
- END IF
- ELSE
- IF LibraryCreate(ls_pbl) = -1 THEN
- rslt = -1
- arg_msg = '创建格式库文件失败,请手动创建'
- END IF
- END IF
-
-
- buildpbl:
- comm = "INSERT INTO " + RightTrim(LeftTrim(sle_database.Text)) + ".dbo.u_setliblist ("+&
- "libname )"+&
- "VALUES"+&
- "("+&
- "'" + LeftTrim(RightTrim(sle_pbl.Text)) + "'"+&
- ");"
- EXECUTE IMMEDIATE :comm USING sqlca;
- IF sqlca.SQLCode = -1 THEN
- rslt = -1
- arg_msg = '请在系统选项设置手动添加该格式库文件'
- GOTO ext
- END IF
- END IF
- ext:
- RETURN rslt
- end function
- public function integer wf_autopbl ();sle_pbl.Text = + 'printbill_' + sle_database.Text+'.pbl'
- RETURN 1
- end function
- event open;call super::open;
- wf_findisql()
- end event
- on w_create_book.create
- int iCurrent
- call super::create
- this.cb_ok=create cb_ok
- this.cb_ch2=create cb_ch2
- this.sle_filename=create sle_filename
- this.st_8=create st_8
- this.gb_1=create gb_1
- this.st_2334=create st_2334
- this.st_345=create st_345
- this.sle_sqldb_mdf_sor=create sle_sqldb_mdf_sor
- this.sle_sqldb_ldf_sor=create sle_sqldb_ldf_sor
- this.cbx_db_h=create cbx_db_h
- this.gb_3=create gb_3
- this.st_jd=create st_jd
- this.st_2=create st_2
- this.sle_database=create sle_database
- this.sle_bookname=create sle_bookname
- this.st_1=create st_1
- this.sle_code=create sle_code
- this.st_3=create st_3
- this.cbx_ifuse=create cbx_ifuse
- this.st_13=create st_13
- this.sle_folder=create sle_folder
- this.cb_2=create cb_2
- this.sle_fj=create sle_fj
- this.cb_fj=create cb_fj
- this.cbx_fj=create cbx_fj
- this.cbx_1=create cbx_1
- this.st_14=create st_14
- this.sle_pbl=create sle_pbl
- iCurrent=UpperBound(this.Control)
- this.Control[iCurrent+1]=this.cb_ok
- this.Control[iCurrent+2]=this.cb_ch2
- this.Control[iCurrent+3]=this.sle_filename
- this.Control[iCurrent+4]=this.st_8
- this.Control[iCurrent+5]=this.gb_1
- this.Control[iCurrent+6]=this.st_2334
- this.Control[iCurrent+7]=this.st_345
- this.Control[iCurrent+8]=this.sle_sqldb_mdf_sor
- this.Control[iCurrent+9]=this.sle_sqldb_ldf_sor
- this.Control[iCurrent+10]=this.cbx_db_h
- this.Control[iCurrent+11]=this.gb_3
- this.Control[iCurrent+12]=this.st_jd
- this.Control[iCurrent+13]=this.st_2
- this.Control[iCurrent+14]=this.sle_database
- this.Control[iCurrent+15]=this.sle_bookname
- this.Control[iCurrent+16]=this.st_1
- this.Control[iCurrent+17]=this.sle_code
- this.Control[iCurrent+18]=this.st_3
- this.Control[iCurrent+19]=this.cbx_ifuse
- this.Control[iCurrent+20]=this.st_13
- this.Control[iCurrent+21]=this.sle_folder
- this.Control[iCurrent+22]=this.cb_2
- this.Control[iCurrent+23]=this.sle_fj
- this.Control[iCurrent+24]=this.cb_fj
- this.Control[iCurrent+25]=this.cbx_fj
- this.Control[iCurrent+26]=this.cbx_1
- this.Control[iCurrent+27]=this.st_14
- this.Control[iCurrent+28]=this.sle_pbl
- end on
- on w_create_book.destroy
- call super::destroy
- destroy(this.cb_ok)
- destroy(this.cb_ch2)
- destroy(this.sle_filename)
- destroy(this.st_8)
- destroy(this.gb_1)
- destroy(this.st_2334)
- destroy(this.st_345)
- destroy(this.sle_sqldb_mdf_sor)
- destroy(this.sle_sqldb_ldf_sor)
- destroy(this.cbx_db_h)
- destroy(this.gb_3)
- destroy(this.st_jd)
- destroy(this.st_2)
- destroy(this.sle_database)
- destroy(this.sle_bookname)
- destroy(this.st_1)
- destroy(this.sle_code)
- destroy(this.st_3)
- destroy(this.cbx_ifuse)
- destroy(this.st_13)
- destroy(this.sle_folder)
- destroy(this.cb_2)
- destroy(this.sle_fj)
- destroy(this.cb_fj)
- destroy(this.cbx_fj)
- destroy(this.cbx_1)
- destroy(this.st_14)
- destroy(this.sle_pbl)
- end on
- type cb_func from w_publ_base`cb_func within w_create_book
- boolean visible = false
- integer x = 1568
- integer y = 1124
- integer taborder = 40
- boolean enabled = false
- end type
- type cb_exit from w_publ_base`cb_exit within w_create_book
- integer x = 1403
- integer y = 1040
- integer width = 315
- integer taborder = 150
- string text = "取消"
- end type
- type cb_ok from uo_imflatbutton within w_create_book
- integer x = 635
- integer y = 1040
- integer width = 315
- integer height = 96
- integer taborder = 140
- string normalpicname = "ok.bmp"
- end type
- event clicked;call super::clicked;
- IF Trim(sle_database.Text) = '' THEN
- MessageBox('提示','请输入数据库名称!',information!,OK!)
- RETURN
- END IF
- IF Trim(sle_database.Text) = '' THEN
- MessageBox('提示','请输入编号!',information!,OK!)
- RETURN
- END IF
- String arg_msg
- IF NOT cbx_1.Checked THEN
-
- IF NOT FileExists(sle_filename.Text) THEN
- MessageBox("提示","指定恢复数据文件不存在",information!,OK!)
- RETURN
- END IF
-
- IF Trim(sle_folder.Text) = '' THEN
- MessageBox('提示','请输入目标文件路径!',information!,OK!)
- RETURN
- END IF
-
- IF wf_buildsqldb(arg_msg) = 0 THEN
- MessageBox("错误",arg_msg,stopsign!,OK!)
- RETURN
- END IF
- END IF
- String ls_ini_book
- Long i
- String ifuse
- FOR i = 1 TO 20
- // ls_ini_book = f_psw_bczh(ProfileString (sys_inifilename_other,'sys_dl_book', String(i), ''),1,sys_power_key)
- ls_ini_book = ProfileString (sys_inifilename_other,'sys_dl_book', String(i), '')
-
- IF Trim(ls_ini_book) = '' THEN
- IF cbx_ifuse.Checked THEN
- ifuse = '1'
- ELSE
- ifuse = '0'
- END IF
- String ls_temp
- ls_temp = RightTrim(LeftTrim(sle_bookname.Text)) + ':'+&
- RightTrim(LeftTrim(sle_database.Text))+ ':'+&
- RightTrim(LeftTrim(sle_code.Text))+ ':'+&
- ifuse
- // SetProfileString (sys_inifilename_other,'sys_dl_book', String(i), f_psw_bczh(ls_temp,0,sys_power_key))
- SetProfileString (sys_inifilename_other,'sys_dl_book', String(i), ls_temp)
- GOTO ext
- END IF
- NEXT
- MessageBox('提示','新建帐套成功!',information!,OK!)
- ext:
- Close(PARENT)
- end event
- type cb_ch2 from commandbutton within w_create_book
- integer x = 2117
- integer y = 340
- integer width = 114
- integer height = 84
- integer taborder = 60
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "..."
- end type
- event clicked;
- Integer i
- String Pathname,Filename
- i = GetFileSaveName("选择主数据库文件",Pathname,Filename,"Dat","数据文件Dat,*.Dat")
- IF i = 1 AND Trim(Pathname) <> '' AND Trim(Filename) <> "" THEN
- sle_filename.Text = Pathname
- END IF
- end event
- type sle_filename from singlelineedit within w_create_book
- integer x = 457
- integer y = 340
- integer width = 1655
- integer height = 80
- integer taborder = 50
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type st_8 from statictext within w_create_book
- integer x = 87
- integer y = 356
- integer width = 370
- integer height = 76
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- boolean enabled = false
- string text = "空数据库来自:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type gb_1 from groupbox within w_create_book
- integer x = 64
- integer width = 2194
- integer height = 656
- integer taborder = 170
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- end type
- type st_2334 from statictext within w_create_book
- integer x = 128
- integer y = 740
- integer width = 329
- integer height = 76
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- boolean enabled = false
- string text = "源数据名称:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type st_345 from statictext within w_create_book
- integer x = 128
- integer y = 840
- integer width = 329
- integer height = 76
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- boolean enabled = false
- string text = "源日志名称:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type sle_sqldb_mdf_sor from singlelineedit within w_create_book
- integer x = 457
- integer y = 724
- integer width = 1655
- integer height = 80
- integer taborder = 100
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean enabled = false
- string text = "ljerp1_data"
- borderstyle borderstyle = stylelowered!
- end type
- type sle_sqldb_ldf_sor from singlelineedit within w_create_book
- integer x = 457
- integer y = 824
- integer width = 1655
- integer height = 80
- integer taborder = 110
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean enabled = false
- string text = "ljerp1_log"
- borderstyle borderstyle = stylelowered!
- end type
- type cbx_db_h from checkbox within w_create_book
- integer x = 101
- integer y = 668
- integer width = 201
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "高级"
- end type
- event clicked;sle_sqldb_mdf_sor.Enabled = THIS.Checked
- sle_sqldb_ldf_sor.Enabled = THIS.Checked
- cbx_fj.Enabled = THIS.Checked
- IF cbx_fj.Checked THEN
- sle_fj.Enabled = THIS.Checked
- cb_fj.Enabled = THIS.Checked
- ELSE
- sle_fj.Enabled = false
- cb_fj.Enabled = false
- END IF
- end event
- type gb_3 from groupbox within w_create_book
- integer x = 64
- integer y = 668
- integer width = 2194
- integer height = 360
- integer taborder = 160
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- end type
- type st_jd from statictext within w_create_book
- integer x = 1664
- integer y = 44
- integer width = 576
- integer height = 64
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 16711680
- long backcolor = 134217739
- boolean enabled = false
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type st_2 from statictext within w_create_book
- integer x = 160
- integer y = 252
- integer width = 297
- integer height = 60
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- long backcolor = 134217739
- boolean enabled = false
- string text = "数据库名称:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type sle_database from singlelineedit within w_create_book
- integer x = 457
- integer y = 240
- integer width = 1655
- integer height = 80
- integer taborder = 30
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- boolean autohscroll = false
- borderstyle borderstyle = stylelowered!
- end type
- event modified;wf_autopbl()
- end event
- type sle_bookname from singlelineedit within w_create_book
- integer x = 457
- integer y = 136
- integer width = 1655
- integer height = 80
- integer taborder = 20
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- boolean autohscroll = false
- borderstyle borderstyle = stylelowered!
- end type
- type st_1 from statictext within w_create_book
- integer x = 201
- integer y = 148
- integer width = 256
- integer height = 60
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- long backcolor = 134217739
- boolean enabled = false
- string text = "帐套名称:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type sle_code from singlelineedit within w_create_book
- integer x = 457
- integer y = 44
- integer width = 503
- integer height = 80
- integer taborder = 10
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- boolean autohscroll = false
- borderstyle borderstyle = stylelowered!
- end type
- type st_3 from statictext within w_create_book
- integer x = 315
- integer y = 56
- integer width = 142
- integer height = 60
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- long backcolor = 134217739
- boolean enabled = false
- string text = "编号:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type cbx_ifuse from checkbox within w_create_book
- integer x = 969
- integer y = 48
- integer width = 215
- integer height = 64
- boolean bringtotop = true
- integer textsize = -8
- integer weight = 400
- fontcharset fontcharset = ansi!
- fontpitch fontpitch = variable!
- fontfamily fontfamily = swiss!
- string facename = "MS Sans Serif"
- long textcolor = 41943040
- long backcolor = 134217739
- string text = "使用"
- boolean checked = true
- end type
- type st_13 from statictext within w_create_book
- integer x = 87
- integer y = 456
- integer width = 370
- integer height = 76
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- boolean enabled = false
- string text = "目标文件路径:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type sle_folder from singlelineedit within w_create_book
- integer x = 457
- integer y = 440
- integer width = 1655
- integer height = 80
- integer taborder = 70
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
- type cb_2 from commandbutton within w_create_book
- integer x = 2117
- integer y = 436
- integer width = 114
- integer height = 84
- integer taborder = 80
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- string text = "..."
- end type
- event clicked;
- //
- //GetFolder()
- //功 能:显示文件夹选择对话框。
- //语 法:GetFolder (title , director )
- //参 数:title:String类型,指定文件夹选择框的标题;
- // directory:String类型,文件夹的路径,即指定显示哪个文件夹下的子文件夹,又用于保存用户最终选择的文件夹的路径。
- //返回值:Integer。函数执行成功时返回1,发生错误时返回-1。当用户选择了”取消”按钮或直接关闭对话框,函数返回0。
- //示 例: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:
- string ls_path
- integer li_result
- ls_path = mid(sys_cur_path,1,len(sys_cur_path )- 1)
- li_result = GetFolder( "目标文件路径", ls_path )
- sle_folder.text=ls_path
- end event
- type sle_fj from singlelineedit within w_create_book
- integer x = 457
- integer y = 924
- integer width = 1655
- integer height = 80
- integer taborder = 120
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- boolean enabled = false
- borderstyle borderstyle = stylelowered!
- end type
- type cb_fj from commandbutton within w_create_book
- integer x = 2117
- integer y = 916
- integer width = 114
- integer height = 84
- integer taborder = 130
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- boolean enabled = false
- string text = "..."
- end type
- event clicked;Integer i
- String Pathname,Filename
- i = GetFileSaveName("选择附件数据库文件",Pathname,Filename,"Dat","数据文件Dat,*.Dat")
- IF i = 1 AND Trim(Pathname) <> '' AND Trim(Filename) <> "" THEN
- sle_fj.Text = Pathname
- END IF
- end event
- type cbx_fj from checkbox within w_create_book
- integer x = 73
- integer y = 932
- integer width = 384
- integer height = 60
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "附件数据库:"
- end type
- event clicked;IF THIS.Checked THEN
- sle_fj.Enabled = TRUE
- cb_fj.Enabled = TRUE
- ELSE
- sle_fj.Enabled = FALSE
- cb_fj.Enabled = FALSE
- END IF
- end event
- type cbx_1 from checkbox within w_create_book
- integer x = 1175
- integer y = 48
- integer width = 466
- integer height = 64
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- string text = "连接现有数据库"
- end type
- event clicked;IF THIS.Checked THEN
- sle_filename.Enabled = FALSE
- cb_ch2.Enabled = FALSE
- sle_folder.Enabled = FALSE
- cb_2.Enabled = FALSE
- cbx_db_h.Enabled = FALSE
- sle_sqldb_mdf_sor.Enabled = FALSE
- sle_sqldb_ldf_sor.Enabled = FALSE
- cbx_fj.Enabled = FALSE
- sle_fj.Enabled = FALSE
- cb_fj.Enabled = FALSE
- sle_pbl.Enabled = FALSE
- ELSE
- sle_filename.Enabled = TRUE
- cb_ch2.Enabled = TRUE
- sle_folder.Enabled = TRUE
- cb_2.Enabled = TRUE
- cbx_db_h.Enabled = TRUE
- sle_pbl.Enabled = TRUE
- sle_sqldb_mdf_sor.Enabled = cbx_db_h.Checked
- sle_sqldb_ldf_sor.Enabled = cbx_db_h.Checked
- cbx_fj.Enabled = cbx_db_h.Checked
- IF cbx_db_h.Checked THEN
- IF cbx_fj.Checked THEN
- sle_fj.Enabled = cbx_fj.Checked
- cb_fj.Enabled = cbx_fj.Checked
- ELSE
- sle_fj.Enabled = FALSE
- cb_fj.Enabled = FALSE
- END IF
- END IF
- END IF
- end event
- type st_14 from statictext within w_create_book
- integer x = 151
- integer y = 532
- integer width = 306
- integer height = 96
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- long backcolor = 134217739
- boolean enabled = false
- string text = "打印格式库文件名称:"
- alignment alignment = right!
- boolean focusrectangle = false
- end type
- type sle_pbl from singlelineedit within w_create_book
- integer x = 457
- integer y = 540
- integer width = 1655
- integer height = 80
- integer taborder = 90
- boolean bringtotop = true
- integer textsize = -9
- integer weight = 400
- fontcharset fontcharset = gb2312charset!
- fontpitch fontpitch = variable!
- string facename = "宋体"
- long textcolor = 33554432
- borderstyle borderstyle = stylelowered!
- end type
|