📄 updatefix.asp
字号:
cat.Tables("reginfo").Columns("Reg_MSN").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_From").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_work").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_for").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_birthday").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_descript").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("userlist").Columns("userPath").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("userlist").Columns("ActivePort").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("userlist").Columns("Reg_Name").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("Groups").Columns("GroupName").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("Groups").Columns("GroupReadme").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("config").Columns("CopyRight").Properties("Jet OLEDB:Allow Zero Length") = True
set cat=nothing
'建立一个级联删除和更新
CONN.execute( "ALTER TABLE [Reginfo] "&_
"ADD CONSTRAINT FK_Reginfo "&_
"FOREIGN KEY (UserID) REFERENCES "&_
"[userlist] (UserID) "&_
"ON UPDATE CASCADE "&_
"ON DELETE CASCADE ")
'按主用户表添加注册记录
rs.open "userlist",conn,0,1
if not rs.bof then
rs1.open "Reginfo",conn,1,3
while Not rs.eof
rs1.addnew
rs1("UserID")=rs("UserID")
rs1("Reg_Name")=rs("UserName")
rs1.update
rs.movenext
wend
rs1.close
end if
rs.close
'探测上传组件
dim upload,loadSA
loadSA=false
on error resume next
set upload=Server.CreateObject("SoftArtisans.FileUp")
if err.number=0 then
loadSA=true
end if
on error goto 0
if loadSA then
CONN.execute("update [config] set upload_Component=1")
else
CONN.execute("update [config] set upload_Component=0")
end if
'最后写1.5数据库版本号
CONN.execute("update [config] set database_Ver=1502,CopyRight=""Create By CooSel V1.5b2""")
CONN.execute("alter table [config] alter column [database_Ver] integer Default 1502")
database_Ver=1502
call delF("code/","folder") '删除code目录
call delF("inc/regtext.txt","file") '
call delF("inc/regtextDEF.txt","file") '
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.exeStr1.innerHTML="";
//-->
</SCRIPT>
<%
End SUB
SUB V1500_V1502()
on error resume next
CONN.execute("alter table [config] add column [CopyRight] varchar(255) Default ""Create By CooSel V1.5b2""")
on error goto 0
if err.number>0 then
CONN.execute("alter table [config] alter column [CopyRight] varchar(255) Default ""Create By CooSel V1.5b2""")
end if
'创建用户组表
CONN.execute("alter table [Groups] alter column [GroupReadme] varchar(255) Default """" not null")
'修改用户表
CONN.execute("alter table [userlist] alter column [userPath] text Default """"")
'修改用户表
CONN.execute("alter table [userlist] add column [Reg_Name] varchar(50) not null default=""""")
CONN.execute("update [userlist] set Reg_Name=UserName")
'添加扩展注册表
CONN.execute("alter table [Reginfo] alter column [Reg_Name] varchar(50) Default """"")
CONN.execute("alter table [Reginfo] alter column [Reg_Number] varchar(20) Default """"")
CONN.execute("alter table [Reginfo] alter column [Reg_phone] varchar(20) Default """"")
CONN.execute("alter table [Reginfo] alter column [Reg_moCall] varchar(20) Default """"")
CONN.execute("alter table [Reginfo] alter column [Reg_OICQ] varchar(20) Default """"")
CONN.execute("alter table [Reginfo] alter column [Reg_MSN] varchar(50) Default """"")
CONN.execute("alter table [Reginfo] alter column [Reg_From] varchar(10) Default """"")
CONN.execute("alter table [Reginfo] alter column [Reg_work] varchar(20) Default """"")
CONN.execute("alter table [Reginfo] alter column [Reg_for] varchar(10) Default """"")
CONN.execute("alter table [Reginfo] alter column [Reg_birthday] varchar(10) Default ""--""")
CONN.execute("alter table [Reginfo] alter column [Reg_descript] text Default """"")
'允许0长度
dim cat
set cat=Server.CreateObject("ADOX.Catalog")
cat.ActiveConnection ="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(dbmdb)
cat.Tables("reginfo").Columns("Reg_Name").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_Number").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_phone").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_moCall").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_OICQ").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_MSN").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_From").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_work").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_for").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_birthday").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("reginfo").Columns("Reg_descript").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("userlist").Columns("userPath").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("userlist").Columns("ActivePort").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("userlist").Columns("Reg_Name").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("Groups").Columns("GroupName").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("Groups").Columns("GroupReadme").Properties("Jet OLEDB:Allow Zero Length") = True
cat.Tables("config").Columns("CopyRight").Properties("Jet OLEDB:Allow Zero Length") = True
set cat=nothing
'最后写1.5数据库版本号
'探测上传组件
dim upload,loadSA
loadSA=false
on error resume next
set upload=Server.CreateObject("SoftArtisans.FileUp")
if err.number=0 then
loadSA=true
end if
on error goto 0
if loadSA then
CONN.execute("update [config] set upload_Component=1")
else
CONN.execute("update [config] set upload_Component=0")
end if
CONN.execute("alter table [Config] alter column [md5order] Integer default 2323")
CONN.execute("update [userlist] set Active=1")
CONN.execute("update [config] set database_Ver=1502,CopyRight=""Create By CooSel V1.5b2""")
CONN.execute("alter table [config] alter column [database_Ver] integer Default 1502")
call delF("code/","folder") '删除code目录
call delF("inc/regtext.txt","file") '
call delF("inc/regtextDEF.txt","file") '
database_Ver=1502
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.exeStr1.innerHTML="";
//-->
</SCRIPT>
<%
End SUB
SUB Compactsys()
Set rs=nothing
Set rs1=nothing
CONN.close
Set CONN=nothing
rem =============系统数据库压缩操作=============
response.write "<span id=exeStr3><br><center> ------>>>>> <img src=""pic/upstats.gif"" align=absmiddle>正在压缩数据库............请等待直到出现成功提示..</center></span>"
Dim Spath,Dpath,Engine, strdpath '全局变量 '
Dim mappathto,spath1,Dpath1,delfileD
DIM dbbakpath '备份数据库目标路径名
dbbakpath="data/bak/"
Spath = dbmdb
Dpath = dbbakpath&"compress.asa"
mappathto=Dpath
spath1=spath
Dpath1=Dpath
delfileD=Dpath
err.clear
on error resume next
call copyFso(SPath, Dpath)
if err.number<>0 then
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.exeStr3.innerHTML="";
//-->
</SCRIPT>
<%
response.write "<font color=#ff0000><b>不支持Fso 无法完成压缩操作</b></font>"
err.clear
exit SUB
end if
on error goto 0
call CompressDB(mappathto)
call copyFso(DPath1, Spath1)
call delF(delfileD,"file")
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.exeStr3.innerHTML="";
//-->
</SCRIPT>
<%
response.write "<center><font color=""#00aa33""><li>数据库压缩完成!!</font></center>"
End SUB
rem ========压缩函数==========
Function CompressDB(Dpath)
dim strdpath,Engine
dim DestPath
dim Fso
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
DestPath = server.mappath(Dpath)
strdpath = left(DestPath,instrrev(DestPath,"\"))
Set Engine = CreateObject("JRO.JetEngine")
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DestPath, _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strdpath & "temp.mdb"
Fso.CopyFile strdpath & "temp.mdb",DestPath
Fso.DeleteFile(strdpath & "temp.mdb")
Set Engine = nothing
Set Fso=nothing
End Function
'Spath,原目录文件,Dpath目标目录文件''
rem ==========拷贝函树==========
Function copyFso(SPath, Dpath)
dim sourcePath
dim Fso
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
sourcePath = server.mappath(Spath)
dim DestPath
DestPath = server.mappath(Dpath)
Fso.copyfile sourcePath,DestPath
Set Fso=nothing
End Function
SUB DelF(Dpath,iType)
on error resume next
dim DestPath,Fso
Set Fso=Server.CreateObject("Scripting.FileSystemObject")
DestPath = server.mappath(Dpath)
if iType="file" then
Fso.DeleteFile(DestPath)
else
Fso.DeleteFolder(DestPath)
end if
Set Fso=nothing
if err.number<>0 then err.clear
on error goto 0
End SUB
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -