aspMicrosoft VBScript 编译器错误 (0x800A0408)无效字符

liujhfly 2011-05-27 03:12:29
aspMicrosoft VBScript 编译器错误 (0x800A0408)
无效字符
/newztjt/test.asp, line 23

是连接数据库时出现的问题,本人在asp连接access数据时总是出现错误,想请教各位,以下是代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<%
set dbconnection=Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("data.mdb")
dbconnection.Open "provider=microsoft.jet.oledb.4.0;data source="&dbpath
SQL="select * from lm where id="" & user_id &"""
SET uplist=dbconnection.EXECUTE(SQL)

%>
<body>
</body>
</html>
<%
  dbconnection.Close() (本行出错)
  Set dbconnection = Nothing

%>
...全文
104 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
a306518193 2011-05-27
  • 打赏
  • 举报
回复
一楼正解!
香椿炒鸡蛋 2011-05-27
  • 打赏
  • 举报
回复
如此即可,非字符串的都这么用
[Quote=引用 1 楼 net_lover 的回复:]
SQL="select * from lm where id=" & user_id
[/Quote]
灬上海爽爷 2011-05-27
  • 打赏
  • 举报
回复
SQL="select * from lm where id=" & user_id &""

这样也行,总之多了一对引号。。
孟子E章 2011-05-27
  • 打赏
  • 举报
回复
SQL="select * from lm where id=" & user_id

28,391

社区成员

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

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