$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