请问在ASP里面一个字符串太长了,需要换行,用什么符号连接

niuyongzljtoo 2003-12-02 04:57:34
请问在ASP里面一个字符串太长了,需要换行,用什么符号连接
...全文
973 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
超级大笨狼 2003-12-03
  • 打赏
  • 举报
回复
dim sql:sql="select * from table "

超级大笨狼 2003-12-03
  • 打赏
  • 举报
回复
冒号可以把两行东西写在一行
dim sql:sql=sql="select * from table "

<td
onclick="vbs:if a=1 then msgbox '1' else msgbox '2':mysubA 23:alert 'hello!'">
超级大笨狼 2003-12-03
  • 打赏
  • 举报
回复
为 MsgBox、InputBox 及 SQL 查询创建字符串
当产生长字符串时,使用下划线连接字符产生多行代码,这样便于阅读或调试字符串。当显示一个消息框 (MsgBox) 或输入框 (InputBox),或产生一个 SQL 字符串时,这一技术特别有用。例如:

Dim Msg As String
Msg = "This is a paragraph that will be " _
& "in a message box. The text is" _
& " broken into several lines of code" _
& " in the source code, making it easier" _
& " for the programmer to read and debug."
MsgBox Msg

Dim QRY As String
QRY = "SELECT *" _
& " FROM Titles" _
& " WHERE [Year Published] > 1988"
TitlesQry.SQL = QRY

超级大笨狼 2003-12-03
  • 打赏
  • 举报
回复
sql=sql & "S"
sql=sql & "e"
sql=sql & "l"
sql=sql & "e"
sql=sql & "c"
sql=sql & "t"
sql=sql & " * from tb"
zhanghao5188 2003-12-03
  • 打赏
  • 举报
回复
& -
  • 打赏
  • 举报
回复
sql="select * from table "
sql=sql & "where id>100 "
sql=sql & "and id<=100"

直接用这个也就行了啊
luoluonet 2003-12-02
  • 打赏
  • 举报
回复
_
aabiao 2003-12-02
  • 打赏
  • 举报
回复
ASP不是语言!!!
VBS用下划线,JS不用
yyhyy23 2003-12-02
  • 打赏
  • 举报
回复
sql="select * from table "
sql=sql & "where id>100 "
sql=sql & "and id<=100"

sql="select * from table " & _
"where id>100 " & _
"and id<=100"
就行了三
skyboy0720 2003-12-02
  • 打赏
  • 举报
回复
就是上面这个了,祝你成功!:)
skyboy0720 2003-12-02
  • 打赏
  • 举报
回复
就是上面那位的了,祝你成功!:)
monkeys 2003-12-02
  • 打赏
  • 举报
回复
不是,现在我有一个很长的SQL语句,要分行写,中间怎么连接
希望对你有帮助:
sql="select * from table "&_
sql=sql&" where id>100"&_
sql=sql&" and id<=100"
yyhyy23 2003-12-02
  • 打赏
  • 举报
回复
& 加 _
yyhyy23 2003-12-02
  • 打赏
  • 举报
回复
不好意识,错了
<% select * from ab " & -
"where ab='ab'"
%>
就是& _
yyhyy23 2003-12-02
  • 打赏
  • 举报
回复
我来告诉你比如说
<%
strsql="select * from ddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" _
" where ab='ab'"
%>
就是这样了,肯定没错
leeboyan 2003-12-02
  • 打赏
  • 举报
回复
sqlstr="part1"
sqlstr=sqlstr+"part2"
bluesmile979 2003-12-02
  • 打赏
  • 举报
回复
&
niuyongzljtoo 2003-12-02
  • 打赏
  • 举报
回复
不是,现在我有一个很长的SQL语句,要分行写,中间怎么连接
leeboyan 2003-12-02
  • 打赏
  • 举报
回复
不懂意思!
是输出吗?
response.write"part1"&"<br>"
response.write"part2"&"<br>"
?
say1no2 2003-12-02
  • 打赏
  • 举报
回复
用&

如:str = "dsfdsfdsfdsf" & "2132sdfds"

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧