这个字符串如何构造?
代码如下:
Function getSchoolName(schoolid)
if schoolid= " " or isnull(schoolid) then
Exit Function
else
set rs = Server.CreateObject( "adodb.recordset ")
rs.open "select school_name from kindergarten where school_id = ' "&schoolid& " ' ",conn,1,1
if not rs.eof then
if rs( "school_name ") <> " " then
getSchoolName = " <img src= " "../ "&rs( "school_name ") "> " -这一行
else
getSchoolName = " <img src= " "../images/logo.gif " "> "
end if
end if
end if
End Function
"这一行 "如何构造正确的字符串,我这样写,提示出错.错误信息:
语句未结束
/bbs/inc/function.asp, line 151, column 50
getSchoolName = " <img src= " "../ "&rs( "school_name ") "> "
-------------------------------------------------^
------解决方案-------------------- " "是不可以的...
在C类语言里 "\ " "
但是VB/VBS里不行...头痛
我以前的做法是 用Chr(Ascii) 来表示 " .... 但是这个数一直记不住
现在干脆就不用 "了..反正无所谓规范不规范的
" <img src=../ " & rs( "school_name ") & "> "
" <img src=../images/logo.gif> "
------解决方案--------------------getSchoolName = " <img src= " "../ " & rs( "school_name ") & " " " /> "
这样就没错了
" 在 VB 中的转义就是: " "