“未结束的字符串常量”这个错误怎么解决?
部分代码如下:
<%
Dim conn,strConn,strSQL
Set conn = Server.CreateObject( "ADODB.Connection ")
strConn = "Driver={SQL Server};Server=COMPUTER;Database=Txl;UID=sa;PWD=123456 "
conn.open
strSQL = "INSERT INTO Linkman(ID,Name,Sex,Phone,Email,RId)
VALUES( 'l00011 ', '罗纳尔多 ', '男 ', '146565 ', 'Ronaldo@sohu.com ', 'R001 ') "
conn.Execute strSQL
conn.Close
Set conn = Nothing
%>
但是运行时有这样的错误:
错误类型:
Microsoft VBScript 编译器错误 (0x800A0409)
未结束的字符串常量
/ASPBooks/E0804.asp, line 16, column 58
strSQL = "INSERT INTO Linkman(ID,Name,Sex,Phone,Email,RId)
---------------------^
这该怎么解决呢?
------解决方案--------------------貌似有回车了
strSQL = "INSERT INTO Linkman(ID,Name,Sex,Phone,Email,RId) VALUES( 'l00011 ', '罗纳尔多 ', '男 ', '146565 ', 'Ronaldo@sohu.com ', 'R001 ') "
------解决方案--------------------strSQL = "INSERT INTO Linkman(ID,Name,Sex,Phone,Email,RId)这里是不是你自己换行了,没有加上连接符。&_
VALUES( 'l00011 ', '罗纳尔多 ', '男 ', '146565 ', 'Ronaldo@sohu.com ', 'R001 ') "