⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setup.asp

📁 一个不错的ASP论坛源码
💻 ASP
📖 第 1 页 / 共 5 页
字号:
		
		UpdateErrorCode = UpdateErrorCheck()
	
		on error goto 0
		
		if UpdateErrorCode = 0 then
			Response.Write("<tr><td bgColor=green align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Upgraded: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2""> Table opened</font></td></tr>")
		else
			Response.Write("<tr><td bgColor=red align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Critical error: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2"">Error while getting Memberlist for transfer<b></font></td></tr>")
			intCriticalErrors = intCriticalErrors + 1
			intTransferErrors = 1
		end if
		
		if intTransferErrors = 0 then
			do while not rsForum.EOF
				if Instr(rsForum("F_USERLIST"),",") > 0 then
					Users = split(rsForum("F_USERLIST"),",")
						for count = Lbound(Users) to Ubound(Users)
							strSql = "INSERT INTO " & strMemberTablePrefix & "ALLOWED_MEMBERS ("
							strSql = strSql & " MEMBER_ID, FORUM_ID) VALUES ( "& Users(count) & ", " & rsForum("FORUM_ID") & ")"	

							on error resume next
							my_Conn.Errors.Clear
							my_Conn.Execute (strSql)
						
							UpdateErrorCode = UpdateErrorCheck()
		
							on error goto 0
							if UpdateErrorCode = 0 then
								Response.Write("<tr><td bgColor=green align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Upgraded: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2""> Added default values for new fields in CONFIG table</font></td></tr>")
							elseif UpdateErrorCode = 2 then
								Response.Write("<tr><td bgColor=red align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Critical error: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2"">Error while adding record ( " & Users(count) & ", " & rsForum("FORUM_ID") & ") to ALLOWED_MEMBER table!<b></font></td></tr>")
								intCriticalErrors = intCriticalErrors + 1
								infTransferErrors = 1
							end if
						next
				end if
	 			rsForum.movenext
			loop
			
		end if
		
		on error resume next
			rsForum.close
			set rsForum = nothing
		on error goto 0
		
		
		if intTransferErrors = 0 then
			Response.Write("<tr><td bgColor=green align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Upgrading: </b></font></td>")
			Response.Write("<td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2"">Finished transferring Member List to ALLOWED_MEMBERS table</font></td></tr>")
		else
			Response.Write("<tr><td bgColor=red align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Upgrading: </b></font></td>")
			Response.Write("<td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2"">Transferring of Member List to ALLOWED_MEMBERS table was NOT succesfull !</font></td></tr>")
		end if
		
		'## Forum_SQL
		strSql = "UPDATE " & strTablePrefix & "CONFIG "
		strSql = strSql & " SET C_STRVERSION =  '" & strNewVersion & "'"
		strSql = strSql & " WHERE CONFIG_ID  =  " & 1

		on error resume next
		my_Conn.Errors.Clear
		my_Conn.Execute (strSql)
	
		Response.Write("<table border=0 cellspacing=0 cellpadding=5 width=""50%"" align=center>")
	
		UpdateErrorCode = UpdateErrorCheck()
	
		on error goto 0
	
		if UpdateErrorCode = 0 then
			Response.Write("<tr><td bgColor=green align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Upgraded: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2""> Added default values for new fields in CONFIG table</font></td></tr>")
		elseif UpdateErrorCode = 2 then
			Response.Write("<tr><td bgColor=red align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Critical error: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2"">Can't add default values for new fields in CONFIG table!<b></font></td></tr>")
			intCriticalErrors = intCriticalErrors + 1
		else
			Response.Write("<tr><td bgColor=red align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Critical error: code: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2"">" & UpdateErrorCode & " while trying to add default values to the CONFIG table</font></td></tr>")
			intCriticalErrors = intCriticalErrors + 1
		end if
		Response.Write("</table>")
		Response.Flush
		
		
		
	end if

	if OldVersion = 5 then
	
	'## just update the version info...
	
		strSql = "UPDATE " & strTablePrefix & "CONFIG "
		strSql = strSql & " SET C_STRVERSION =  '" & strNewVersion & "'"
		strSql = strSql & " WHERE CONFIG_ID = " & 1

		on error resume next
		my_Conn.Errors.Clear
		my_Conn.Execute (strSql)
	
		Response.Write("<table border=""0"" cellspacing=""0"" cellpadding=""5"" width=""50%"" align=""center"">")
	
		UpdateErrorCode = UpdateErrorCheck()
	
		on error goto 0
	
		if UpdateErrorCode = 0 then
			Response.Write("<tr><td bgColor=green align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Upgraded: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2""> Added default values for new fields in CONFIG table</font></td></tr>")
		elseif UpdateErrorCode = 2 then
			Response.Write("<tr><td bgColor=red align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Critical error: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2"">Can't add default values for new fields in CONFIG table!<b></font></td></tr>")
			intCriticalErrors = intCriticalErrors + 1
		else
			Response.Write("<tr><td bgColor=red align=""left"" width=""30%""><font face=""宋体, Arial, Helvetica"" size=""2""><b>Critical error: code: </b></font></td><td bgColor=navyblue align=""left""><font face=""宋体, Arial, Helvetica"" size=""2"">" & UpdateErrorCode & " while trying to add default values to the CONFIG table</font></td></tr>")
			intCriticalErrors = intCriticalErrors + 1
		end if
		Response.Write("</table>")
		Response.Flush
	
	end if

my_Conn.Close
set my_Conn = nothing

if intCriticalErrors = 0 then
%>
	<p><font face="宋体, Arial, Helvetica" size="4">The Upgrade has been completed without errors !</font></p>
<%
else
%>
	<p><font face="宋体, Arial, Helvetica" size="4"><b>The Upgrade has NOT been completed without errors !</b></font></p>
	<p><font face="宋体, Arial, Helvetica" size="2">There were <%=intCriticalErrors %>  Critical Errors...</font></p>
<%
	if intWarnings > 0 then
%>
	<p><font face="宋体, Arial, Helvetica" size="2">There were <%=intWarnings %>  noncritical errors...</font></p>
<%
	end if
end if
if intCriticalErrors > 0 then
%>
	<p><font face="宋体, Arial, Helvetica" size="2"><a href="setup.asp?RC=3">Click here to retry....</a></font></p>
<%
end if
%>
	<p><font face="宋体, Arial, Helvetica" size="2"><a href="default.asp" target="_top">Click here to return to the forum....</a></font></p>
	
</center></div>
<%
		Application(strCookieURL & "ConfigLoaded")= ""

	else
		Response.Redirect "setup_logon.asp"
	end if

elseif ResponseCode = 5 then '## install a new database

	if strDBType = "access" then '## install is not available for Access !
		Response.Redirect "setup.asp"
	else

%>	
	<div align=center><center>
	<p><font face="宋体, Arial, Helvetica" size="4">Installation of forum-tables in the database.</font></p>
	</center></div>
<form action="setup.asp?RC=6" method="post" id=Form1 name=Form1>
<table border="0" cellspacing="0" cellpadding="5" width="50%" height="50%" align="center">
	<tr>
		<td bgColor=navyblue align="left"><font face="宋体, Arial, Helvetica" size="2">
		<p>
		<% if strDBType = "sqlserver" then %>
		  <p>Select the SQL-server version you are using:</p>
          <p><input type="radio" class="radio" name="SQL_Server" value="SQL6" >SQL-Server 6.5<br>
          <input type="radio" class="radio" checked name="SQL_Server" value="SQL7">SQL-Server 7&nbsp;&nbsp;&nbsp;</p>
        <% end if %>
          <p>To install the tables in the database you need to create the empty database on the server first.<br>
          Then you have to provide a username and password of a user that has table creation/modification rights at the database you use.<br>
          This might not be the same user as you use in your connectionstring !<br>
          <br>
          Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" name="DBUserName" size="20"><br>
          Password: <input type="password" name="DBPassword" size="20"></p>
   
          </font>
        </td>
		</tr>	
		<tr>
			  <td align="center"><input type="submit" value="Continue" id="Submit1" name="Submit1"></td>
		</tr>
		</form>
</table>	
<%
	end if

elseif ResponseCode = 6 then '## start installing the tables in the database

	if strDBType = "access" Then '## install is not available for access !
		Response.Redirect "setup.asp"
	else

%>	
	<div align=center><center>
	<p><font face="宋体, Arial, Helvetica" size="4">Please Wait until the installation has been completed !</font></p>
<%
	on error resume next
	
	strInstallString = strConnString
	
	if strDBType <> "access" then
		strInstallString = CreateConnectionString(strConnString, Request.Form("DBUserName"), Request.Form("DBPassword"))
	end if
	
	set my_Conn = Server.CreateObject("ADODB.Connection")
	my_Conn.Open strInstallString
	
	for counter = 0 to my_conn.Errors.Count -1
		ConnErrorNumber = my_conn.Errors(counter).Number
		if ConnErrorNumber <> 0 then 
			my_conn.Errors.Clear 
			Response.Redirect "setup.asp?RC=1&EC=" & ConnErrorNumber & "&RET=" & Server.URLEncode("setup.asp?RC=5")
		end if
	next
	
	on error goto 0
	
	intCriticalErrors = 0
	
%>
<table border="0" cellspacing="0" cellpadding="5" width="50%" height="50%" align="center">
	<tr>
	<%
strSQL_Server = Request.Form("Sql_Server")

if strDBType = "mysql" then %>
<!--#INCLUDE FILE="inc_create_forum_mysql.asp" -->
<%
elseif strDBType = "sqlserver" then
	if strSQL_Server = "SQL6" then %>
<!--#INCLUDE FILE="inc_create_forum_sql6.asp" -->
<%  else
%>
<!--#INCLUDE FILE="inc_create_forum_sql7.asp" -->
<%  end if
end if %>
	</tr>
</table>
<%

	my_Conn.Close
	set my_Conn = nothing
	

	if intCriticalErrors = 0 then
%>
	<p><font face="宋体, Arial, Helvetica" size="4">The Installation has been completed !</font></p>
<%
	else
%>
	<p><font face="宋体, Arial, Helvetica" size="4"><b>The Installation has NOT been completed !</b></font></p>
	<p><font face="宋体, Arial, Helvetica" size="2">There were <%=intCriticalErrors %>  Critical Errors...</font></p>
<%
	end if
	if intCriticalErrors > 0 then
%>
	<p><font face="宋体, Arial, Helvetica" size="2"><a href="setup.asp?RC=5">Click here to retry....</a></font></p>
<%
	end if
%>
	<p><font face="宋体, Arial, Helvetica" size="2"><a href="setup.asp" target="_top">Click here to check the Database....</a></font></p>
	
</center></div>

<%
	end if
else
%>
<html>

<head>
<title>Undefined error !!</title>
<meta name="copyright" content="Snitz Forums 2000 Version 3.1 SR4 汉化修改:资源搜罗站">
<Style><!--
a:link    {color:<% =strLinkColor %>;text-decoration:<% =strLinkTextDecoration %>}
a:visited {color:<% =strVisitedLinkColor %>;text-decoration:<% =strVisitedTextDecoration %>}
a:hover   {color:<% =strHoverFontColor %>;text-decoration:<% =strHoverTextDecoration %>}
--></style>
</head>

<body bgColor="white" text="midnightblue" link="darkblue" aLink=red vLink="red" onLoad="window.focus()">


<div align=center><center>
	<font face="宋体, Arial, Helvetica" size="4">There has been an error !!</font>
</center><

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -