asp提示無(wú)效使用 Null: Replace_ASP教程
推薦:用通ASP直接獲取用戶真實(shí)IP地址通用FUNCTION,如果不能取真實(shí)IP,就會(huì)取代理IP Private Function getIP() Dim strIPAddr If Request.ServerVariables(HTTP_X_FORWARDED_FOR) = OR InStr(Request.ServerVariables(HTTP_X_FORWARDED_FOR), unknown) 0 Then strIPAddr = Request.ServerVariables(REMOTE
使用REPLACE來將數(shù)據(jù)庫(kù)里讀出來的數(shù)據(jù)替換,如果字段不為空是正常,但如果
為空時(shí)就出現(xiàn)以下提示:
Microsoft VBScript 運(yùn)行時(shí)錯(cuò)誤 錯(cuò)誤 '800a005e'
無(wú)效使用 Null: 'Replace'
主要問題就是sqlserver的字段為null,所以不能簡(jiǎn)單的為空判斷,只能使用isnull
可以先判斷
if isnull(rs("coutent"))=false then
response.write("null")
else
response.write replace(rs("coutent"),chr(13),"<br/>")
end if
測(cè)試:
代碼如下:
if isnull(keyword)=true then keyword=dxy_title
if isnull(descriptions)=true then descriptions=dxy_title
分享:使用ASP中的VB ActiveX.dll文件沒有人會(huì)在沒有必要的情況下采用更加麻煩的方法來工作,除非是沒有選擇的余地。所以如果我要告訴你有一種簡(jiǎn)單的技術(shù)可以使你的ASP開發(fā)更加快速,并且更加高效率,你一定對(duì)此特別感興趣。這一方法將從你的ASP頁(yè)中的絕大部分business logic轉(zhuǎn)移到一個(gè)Visual Basic Active
- 相關(guān)鏈接:
- 教程說明:
ASP教程-asp提示無(wú)效使用 Null: Replace
。