下面是我的傳統的ASP應用程序的我的服務器端ASP代碼:ASP LEN()函數返回類型不匹配錯誤
Function isValidPACSSession()
...
Dim sessionID : sessionID = Request.QueryString("forSessionID")
isValidPACSSession = SessionID2PACSUserID(sessionID)
...
End Function
Function SessionID2PACSUserID(sSessionID)
if (Not IsNull(sSessionID) AND Len(sSessionID) > 0) then
...it fails here at the Len function.
else
...
end if
End Function
LEN()函數拋出此partcular例如「類型不匹配」的錯誤,wheras其他電話由其他組件創建SessionID2PACSUserID()就好了。請幫忙。
如果'Request.QueryString(「forSessionID」)'爲null,它將會失敗,請確保它不是通過這個小技巧'sessionID = Request.QueryString(「forSessionID」)&「」'或Len(sSessionID &「」)'*(個人喜歡在設置我的變量時做)*。更大的問題是,爲什麼你傳遞sessionID作爲查詢字符串? – Lankymart
可能重複[如果不是在ASP經典](http://stackoverflow.com/questions/33254463/if-not-isnull-in-asp-classic) – Lankymart
這是probelem,我檢查了調試器 請求.QueryString(「forSessionID」)的值爲字符串類型的「F50DAA7A37494A51A0A157D917FACF891129」。 len()函數拋出類型不匹配錯誤。 –