我刚刚被迫将论坛从旧的Windows 2002服务器转移到新的2012年。
这是一个古老的经典ASP论坛(SNITZ(,它是"香草",并且多年来一直很开心。
弄清楚新的连接字符串以使MySQL在此服务器上连接时,该论坛现在正在对其确实不应该
的地方扔下以下错误Microsoft VBScript运行时错误'800A000D'
键入不匹配
/forum/inc_moderation.asp,第74行
似乎是检查数值值(从数据库查询中分配给变量(。这是以上示例的函数:
function CheckForUnmoderatedPosts(CType, CatID, ForumID, TopicID)
Dim PostCount
PostCount = 0
if strModeration > 0 then
' Check the Topics Table first
strSql = "Select Count(*) as PostCount"
strSql = strSql & " FROM " & strTablePrefix & "TOPICS T"
if CType = "CAT" then
strSql = strSql & " WHERE T.CAT_ID = " & CatID & " AND T.T_STATUS > 1 "
elseif CType = "FORUM" then
strSql = strSql & " WHERE T.FORUM_ID = " & ForumID & " AND T.T_STATUS > 1 "
elseif CType = "TOPIC" then
strSql = strSql & " WHERE T.TOPIC_ID = " & TopicID & " AND T.T_STATUS > 1 "
elseif CType = "POSTAUTHOR" then
strSql = strSql & " WHERE T.T_AUTHOR = " & MemberID & " AND T.T_STATUS > 1 AND T.TOPIC_ID = " & TopicID
end if
if CType = "BOARD" then
strSql = strSql & ", " & strTablePrefix & "CATEGORY C"
strSql = strSql & ", " & strtablePrefix & "FORUM F"
' This line makes sure that moderation is still set in the Category
strSql = strSql & " WHERE T.CAT_ID = C.CAT_ID AND C.CAT_MODERATION > 0"
' This line makes sure that moderation is still set to all posts or topic in the Forum
strSql = strSql & " AND T.FORUM_ID = F.FORUM_ID AND F.F_MODERATION in (1,2)" & " AND T.T_STATUS > 1 "
end if
set rsCheck = my_Conn.Execute(strSql)
if not rsCheck.EOF then
PostCount = rsCheck("PostCount")
else
PostCount = 0
end if
if PostCount = 0 then
' If no unmoderated posts are found on the topic table, check the replies.....
strSql = "Select Count(*) as PostCount"
strSql = strSql & " FROM " & strTablePrefix & "REPLY R"
if CType = "CAT" then
strSql = strSql & " WHERE R.CAT_ID = " & CatID & " AND R.R_STATUS > 1 "
elseif CType = "FORUM" then
strSql = strSql & " WHERE R.FORUM_ID = " & ForumID & " AND R.R_STATUS > 1 "
elseif CType = "TOPIC" then
strSql = strSql & " WHERE R.TOPIC_ID = " & TopicID & " AND R.R_STATUS > 1 "
elseif cType = "POSTAUTHOR" then
strSql = strSql & " WHERE R.R_AUTHOR = " & MemberID & " AND R.R_STATUS > 1 AND R.TOPIC_ID = " & TopicID
end if
if CType = "BOARD" then
strSql = strSql & ", " & strTablePrefix & "CATEGORY C"
strSql = strSql & ", " & strtablePrefix & "FORUM F"
' This line makes sure that moderation is still set in the Category
strSql = strSql & " WHERE R.CAT_ID = C.CAT_ID AND C.CAT_MODERATION > 0"
' This line makes sure that moderation is still set to all posts or reply in the Forum
strSql = strSql & " AND R.FORUM_ID = F.FORUM_ID AND F.F_MODERATION in (1,3)" & " AND R.R_STATUS > 1 "
end if
rsCheck.close
set rsCheck = my_Conn.Execute(strSql)
if not rsCheck.EOF then
PostCount = rsCheck("PostCount")
else
PostCount = 0
end if
end if
rsCheck.close
set rsCheck = nothing
end if
CheckForUnModeratedPosts = PostCount
end function
第74行是:如果PostCount = 0,则
为什么会导致类型不匹配?这不仅是这个脚本 - 我设法通过在后计数上放置"装饰"来修复此脚本(因此将其更改为(:
if trim(PostCount) = 0 then
修复了它,但是(许多(其他脚本正在引起同样的问题。
我已经搜索了自己的最佳能力,但找不到其他尝试。(我发现的最接近的是此线程:IIS7,经典ASP;键入不匹配错误,但我看不到如何使该配置适用于我的配置(
滚动回到5.1并使用以下连接字符串解决了问题:
"driver=MySQL ODBC 5.1 Driver;option=16387;server=localhost;uid=xxxxxxx;pwd=yyyyyyy;database=zzzzzzz"
看看我如何达到此修复程序并更好地了解出了问题的问题,请查看我的原始帖子上的评论线程(简而言之,看起来数据库正在从数据库的计数语句中返回一个奇怪的vartype将其与整数进行比较。这似乎是ODBC驱动程序问题,因为较旧的驱动程序修复了此问题(