📄 setup.asp
字号:
NewColumns2(26, ConstraintMySQL) = "DEFAULT 0 NULL"
NewColumns2(27, Prefix) = strTablePrefix
NewColumns2(27, FieldName) = "C_STRMARSTATUS"
NewColumns2(27, TableName) = "CONFIG"
NewColumns2(27, DataType_Access) = "SMALLINT"
NewColumns2(27, DataType_SQL6) = "SMALLINT"
NewColumns2(27, DataType_SQL7) = "SMALLINT"
NewColumns2(27, DataType_MySQL) = "SMALLINT"
NewColumns2(27, ConstraintAccess) = "NULL"
NewColumns2(27, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC1012 DEFAULT 0"
NewColumns2(27, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC1012 DEFAULT 0"
NewColumns2(27, ConstraintMySQL) = "DEFAULT 0 NULL"
NewColumns2(28, Prefix) = strTablePrefix
NewColumns2(28, FieldName) = "C_STRFAVLINKS"
NewColumns2(28, TableName) = "CONFIG"
NewColumns2(28, DataType_Access) = "SMALLINT"
NewColumns2(28, DataType_SQL6) = "SMALLINT"
NewColumns2(28, DataType_SQL7) = "SMALLINT"
NewColumns2(28, DataType_MySQL) = "SMALLINT"
NewColumns2(28, ConstraintAccess) = "NULL"
NewColumns2(28, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC1013 DEFAULT 0"
NewColumns2(28, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC1013 DEFAULT 0"
NewColumns2(28, ConstraintMySQL) = "DEFAULT 0 NULL"
NewColumns2(29, Prefix) = strTablePrefix
NewColumns2(29, FieldName) = "C_STRRECENTTOPICS"
NewColumns2(29, TableName) = "CONFIG"
NewColumns2(29, DataType_Access) = "SMALLINT"
NewColumns2(29, DataType_SQL6) = "SMALLINT"
NewColumns2(29, DataType_SQL7) = "SMALLINT"
NewColumns2(29, DataType_MySQL) = "SMALLINT"
NewColumns2(29, ConstraintAccess) = "NULL"
NewColumns2(29, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC1014 DEFAULT 0"
NewColumns2(29, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC1014 DEFAULT 0"
NewColumns2(29, ConstraintMySQL) = "DEFAULT 0 NULL"
call AddColumns(NewColumns2, intCriticalErrors, intWarnings)
'## Forum_SQL
strSql = "UPDATE " & strTablePrefix & "CONFIG "
strSql = strSql & " SET C_STRVERSION = '" & strNewVersion & "'"
strSql = strSql & " , C_STRFULLNAME = " & 0
strSql = strSql & " , C_STRPICTURE = " & 0
strSql = strSql & " , C_STRSEX = " & 0
strSql = strSql & " , C_STRCITY = " & 0
strSql = strSql & " , C_STRSTATE = " & 0
strSql = strSql & " , C_STRAGE = " & 0
strSql = strSql & " , C_STRCOUNTRY = " & 1
strSql = strSql & " , C_STROCCUPATION = " & 0
strSql = strSql & " , C_STRHOMEPAGE = " & 1
strSql = strSql & " , C_STRFAVLINKS = " & 1
strSql = strSql & " , C_STRICQ = " & 1
strSql = strSql & " , C_STRYAHOO = " & 1
strSql = strSql & " , C_STRAIM = " & 1
strSql = strSql & " , C_STRBIO = " & 0
strSql = strSql & " , C_STRHOBBIES = " & 0
strSql = strSql & " , C_STRLNEWS = " & 0
strSql = strSql & " , C_STRQUOTE = " & 0
strSql = strSql & " , C_STRMARSTATUS = " & 0
strSql = strSql & " , C_STRRECENTTOPICS = " & 0
strSql = strSql & " WHERE CONFIG_ID = " & 1
on error resume next
my_Conn.Errors.Clear
Err.Clear
my_Conn.Execute (strSql)
Response.Write("<table border=""0"" cellspacing=""0"" cellpadding=""5"" width=""50%"" align=""center"">" & vbNewLine)
UpdateErrorCode = UpdateErrorCheck()
on error goto 0
if UpdateErrorCode = 0 then
Response.Write(" <tr>" & vbNewLine)
Response.Write(" <td bgColor=""green"" align=""left"" width=""30%""><font face=""Verdana, Arial, Helvetica"" size=""2""><b>Upgraded: </b></font></td>" & vbNewLine)
Response.Write(" <td bgColor=""#9FAFDF"" align=""left""><font face=""Verdana, Arial, Helvetica"" size=""2""> Added default values for new fields in CONFIG table</font></td>" & vbNewLine)
Response.Write(" </tr>" & vbNewLine)
elseif UpdateErrorCode = 2 then
Response.Write(" <tr>" & vbNewLine)
Response.Write(" <td bgColor=""red"" align=""left"" width=""30%""><font face=""Verdana, Arial, Helvetica"" size=""2""><b>Critical error: </b></font></td>" & vbNewLine)
Response.Write(" <td bgColor=""#9FAFDF"" align=""left""><font face=""Verdana, Arial, Helvetica"" size=""2"">Can't add default values for new fields in CONFIG table!</font></td>" & vbNewLine)
Response.Write(" </tr>" & vbNewLine)
intCriticalErrors = intCriticalErrors + 1
else
Response.Write(" <tr>" & vbNewLine)
Response.Write(" <td bgColor=""red"" align=""left"" width=""30%""><font face=""Verdana, Arial, Helvetica"" size=""2""><b>Critical error: code: </b></font></td>" & vbNewLine)
Response.Write(" <td bgColor=""#9FAFDF"" align=""left""><font face=""Verdana, Arial, Helvetica"" size=""2"">" & Hex(UpdateErrorCode) & " while trying to add default values to the CONFIG table</font></td>" & vbNewLine)
Response.Write(" </tr>" & vbNewLine)
intCriticalErrors = intCriticalErrors + 1
end if
Response.Write("</table>" & vbNewLine)
Response.Flush
end if
'###########################################################################
'##
'## Set up for update 3
'##
'## Database updates needed
'##
'## FORUM_FORUM
'## Need F_PASSWORD set to 255 Char's to handle NT Group Names.
'##
'###########################################################################
if (OldVersion <= 3) then
Dim NewColumns3(2,11)
NewColumns3(0, Prefix) = strTablePrefix
NewColumns3(0, FieldName) = "C_STRAUTOLOGON"
NewColumns3(0, TableName) = "CONFIG"
NewColumns3(0, DataType_Access) = "SMALLINT"
NewColumns3(0, DataType_SQL6) = "SMALLINT"
NewColumns3(0, DataType_SQL7) = "SMALLINT"
NewColumns3(0, DataType_MySQL) = "SMALLINT"
NewColumns3(0, ConstraintAccess) = "NULL"
NewColumns3(0, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC1015 DEFAULT 0"
NewColumns3(0, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC1015 DEFAULT 0"
NewColumns3(0, ConstraintMySQL) = "DEFAULT '0' NULL"
NewColumns3(1, Prefix) = strTablePrefix
NewColumns3(1, FieldName) = "C_STRNTGROUPS"
NewColumns3(1, TableName) = "CONFIG"
NewColumns3(1, DataType_Access) = "SMALLINT"
NewColumns3(1, DataType_SQL6) = "SMALLINT"
NewColumns3(1, DataType_SQL7) = "SMALLINT"
NewColumns3(1, DataType_MySQL) = "SMALLINT"
NewColumns3(1, ConstraintAccess) = "NULL"
NewColumns3(1, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC1016 DEFAULT 0"
NewColumns3(1, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC1016 DEFAULT 0"
NewColumns3(1, ConstraintMySQL) = "DEFAULT '0' NULL"
NewColumns3(2, Prefix) = strTablePrefix
NewColumns3(2, FieldName) = "F_PASSWORD_NEW"
NewColumns3(2, TableName) = "FORUM"
NewColumns3(2, DataType_Access) = "TEXT (255)"
NewColumns3(2, DataType_SQL6) = "VARCHAR (255)"
NewColumns3(2, DataType_SQL7) = "NVARCHAR (255)"
NewColumns3(2, DataType_MYSQL) = "VARCHAR (255)"
NewColumns3(2, ConstraintAccess) = "NULL"
NewColumns3(2, ConstraintSQL6) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC1017 DEFAULT ''"
NewColumns3(2, ConstraintSQL7) = "NULL CONSTRAINT " & strTablePrefix & "SnitzC1017 DEFAULT ''"
NewColumns3(2, ConstraintMySQL) = "DEFAULT '' NULL"
call AddColumns(NewColumns3, intCriticalErrors, intWarnings)
Dim SpecialSql3(4)
SpecialSql3(Access) = "UPDATE " & strTablePrefix & "FORUM SET F_PASSWORD_NEW = F_PASSWORD"
SpecialSql3(SQL6) = "UPDATE " & strTablePrefix & "FORUM SET F_PASSWORD_NEW = F_PASSWORD"
SpecialSql3(SQL7) = "UPDATE " & strTablePrefix & "FORUM SET F_PASSWORD_NEW = F_PASSWORD"
SpecialSql3(MySql) = "UPDATE " & strTablePrefix & "FORUM SET F_PASSWORD_NEW = F_PASSWORD"
strOkMessage = "Password field conversion step 1 of 2 completed"
call SpecialUpdates(SpecialSql3, strOkMessage)
SpecialSql3(Access) = "ALTER TABLE " & strTablePrefix & "FORUM DROP COLUMN F_PASSWORD"
SpecialSql3(SQL6) = "SELECT * FROM " & strTablePrefix & "CONFIG " '## dummy sql-statement SQL6.5 doesn't allow DROP !!
SpecialSql3(SQL7) = "ALTER TABLE " & strTablePrefix & "FORUM DROP COLUMN F_PASSWORD"
SpecialSql3(MySql) = "ALTER TABLE " & strTablePrefix & "FORUM DROP COLUMN F_PASSWORD"
strOkMessage = "Password field conversion step 2 of 2 completed"
call SpecialUpdates(SpecialSql3, strOkMessage)
'## Forum_SQL
strSql = "UPDATE " & strTablePrefix & "CONFIG "
strSql = strSql & " SET C_STRVERSION = '" & strNewVersion & "'"
strSql = strSql & " , C_STRAUTOLOGON = " & 0
strSql = strSql & " , C_STRNTGROUPS = " & 0
strSql = strSql & " WHERE CONFIG_ID = " & 1
on error resume next
my_Conn.Errors.Clear
Err.Clear
my_Conn.Execute (strSql)
Response.Write("<table border=""0"" cellspacing=""0"" cellpadding=""5"" width=""50%"" align=""center"">" & vbNewLine)
UpdateErrorCode = UpdateErrorCheck()
on error goto 0
if UpdateErrorCode = 0 then
Response.Write(" <tr>" & vbNewLine)
Response.Write(" <td bgColor=""green"" align=""left"" width=""30%""><font face=""Verdana, Arial, Helvetica"" size=""2""><b>Upgraded: </b></font></td>" & vbNewLine)
Response.Write(" <td bgColor=""#9FAFDF"" align=""left""><font face=""Verdana, Arial, Helvetica"" size=""2""> Added default values for new fields in CONFIG table</font></td>" & vbNewLine)
Response.Write(" </tr>" & vbNewLine)
elseif UpdateErrorCode = 2 then
Response.Write(" <tr>" & vbNewLine)
Response.Write(" <td bgColor=""red"" align=""left"" width=""30%""><font face=""Verdana, Arial, Helvetica"" size=""2""><b>Critical error: </b></font></td>" & vbNewLine)
Response.Write(" <td bgColor=""#9FAFDF"" align=""left""><font face=""Verdana, Arial, Helvetica"" size=""2"">Can't add default values for new fields in CONFIG table!</font></td>" & vbNewLine)
Response.Write(" </tr>" & vbNewLine)
intCriticalErrors = intCriticalErrors + 1
else
Response.Write(" <tr>" & vbNewLine)
Response.Write(" <td bgColor=""red"" align=""left"" width=""30%""><font face=""Verdana, Arial, Helvetica"" size=""2""><b>Critical error: code: </b></font></td>" & vbNewLine)
Response.Write(" <td bgColor=""#9FAFDF"" align=""left""><font face=""Verdana, Arial, Helvetica"" size=""2"">" & Hex(UpdateErrorCode) & " while trying to add default values to the CONFIG table</font></td>" & vbNewLine)
Response.Write(" </tr>" & vbNewLine)
intCriticalErrors = intCriticalErrors + 1
end if
Response.Write("</table>" & vbNewLine)
Response.Flush
end if
'###########################################################################
'##
'## Setup for update 4
'##
'###########################################################################
if (OldVersion <= 4) then
Dim SpecialSql4(4)
SpecialSql4(Access) = "CREATE TABLE " & strTablePrefix & "ALLOWED_MEMBERS ("
SpecialSql4(Access) = SpecialSql4(Access) & "MEMBER_ID INT NOT NULL, FORUM_ID INT NOT NULL, "
SpecialSql4(Access) = SpecialSql4(Access) & "CONSTRAINT " & strTablePrefix & "SnitzC373 PRIMARY KEY (MEMBER_ID, FORUM_ID) ) "
SpecialSql4(SQL6) = "CREATE TABLE " & strTablePrefix & "ALLOWED_MEMBERS ("
SpecialSql4(SQL6) = SpecialSql4(SQL6) & "MEMBER_ID INT NOT NULL, FORUM_ID INT NOT NULL , "
SpecialSql4(SQL6) = SpecialSql4(SQL6) & "CONSTRAINT " & strTablePrefix & "SnitzC373 PRIMARY KEY NONCLUSTERED (MEMBER_ID, FORUM_ID) )"
SpecialSql4(SQL7) = "CREATE TABLE " & strTablePrefix & "ALLOWED_MEMBERS ("
SpecialSql4(SQL7) = SpecialSql4(SQL7) & "MEMBER_ID INT NOT NULL, FORUM_ID INT NOT NULL , "
SpecialSql4(SQL7) = SpecialSql4(SQL7) & "CONSTRAINT " & strTablePrefix & "SnitzC373 PRIMARY KEY NONCLUSTERED (MEMBER_ID, FORUM_ID) )"
SpecialSql4(MySql) = "CREATE TABLE " & strTablePrefix & "ALLOWED_MEMBERS ("
SpecialSql4(MySql) = SpecialSql4(MySql) & "MEMBER_ID INT (11) NOT NULL, FORUM_ID smallint (6) NOT NULL , "
SpecialSql4(MySql) = SpecialSql4(MySql) & "PRIMARY KEY (MEMBER_ID, FORUM_ID) ) "
strOkMessage = "Table ALLOWED_MEMBERS created "
call SpecialUpdates(SpecialSql4, strOkMessage)
Response.Flush
Response.Write("<table border=""0"" cellspacing=""0"" cellpadding=""5"" width=""50%"" align=""center"">" & vbNewLine)
Response.Write(" <tr>" & vbNewLine)
Response.Write(" <td bgColor=""green"" align=""left"" width=""30%""><font face=""Verdana, Arial, Helvetica"" size=""2""><b>Upgrading: </b></font></td>" & vbNewLine)
Response.Write(" <td bgColor=""#9FAFDF"" align=""left""><font face=""Verdana, Arial, Helvetica"" size=""
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -