strTemp使用出错了,请高手帮帮我!

来源:百度知道 编辑:UC知道 时间:2024/05/12 01:30:14
我定义了这样一个过程:

sub ShowProductContent(rsArticle)
dim i,strTemp
i=0
do while not rsArticle.eof
strTemp = strTemp & ""
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td class="celllist1" width="80">"
strTemp= strTemp & "<div align=center><a href=productInfo.asp?productId=" & rsArticle("ProductID") & ">"
strTemp= strTemp & "<img border=0 src=" & rsArticle("DefaultPicUrl") & " height=100>"
strTemp= strTemp & "</a></div>"
strTemp= strTemp & "</td>"
strTemp= strTemp & "<td class="cellList1" width="387">"
strTemp= strTemp & "<a href=productInfo.asp?ProductID=" & rsArticle("Produc

“"”内的引号必须输入两次,否则会出错
比如显示消息框的内容为“"abc"”必须输入Msgbox """abc"""
因为要想让vb把“"”号当成字符串来使用必须输入两个“"”,否则vb会识别成分隔符

以下三种方法皆可显示“"abc"”
Private Sub Command1_Click()
MsgBox """abc"""
End Sub

Private Sub Command2_Click()
MsgBox Chr(34) & "abc" & Chr(34)
End Sub

Private Sub Command3_Click()
Dim x As String
x = """"
MsgBox x & "abc" & x
End Sub