asp连接mysql 报错

kwj 2008-11-21 01:34:28
下面的一段代码报如下错误,望高人指点迷津

Microsoft VBScript 编译器错误 error '800a0409'

未结束的字符串常量

/kwj/connmysql.asp, line 9



<html>
<head>
 <title>MySQL连接测试</title>
 <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
 
 <%
strconnection="dsn=mysqltest;
  Driver={MySQL ODBC 5.1 Driver};
  server=localhost;uid=root;pwd=root;database=test"
 
 
  set conn = server.createobject("adodb.connection")
  conn.open strconnection
  sql = "select * from user"
  set rs = conn.execute(sql)
  if not rs.bof then

 %>

 <table width="167">
 <tr>
  <td width="76"><b>name</b></td>
  <td width="79"><b>sex</b></td>
 </tr>
 <%
  do while not rs.eof
 %>
 <tr>
  <td><%=rs("name")%></td>
  <td><%=rs("sex")%></td>
 </tr>
 <%
   rs.movenext
  loop
 %>
 </table>

 <%
  else
   response.write("sorry, no data found.")
  end if
  rs.close
  conn.close
  set conn = nothing
  set rs = nothing
 %>
</body>
</html>
...全文
58 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
wcwtitxu 2008-11-23
  • 打赏
  • 举报
回复
strconnection="dsn=mysqltest;Driver={MySQL ODBC 5.1 Driver};server=localhost;uid=root;pwd=root;database=test"


不要断行

28,391

社区成员

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

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