标题:ASP代码错误
取消只看楼主
ds15fkcjj
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2012-12-8
结帖率:37.5%
已结贴  问题点数:4 回复次数:1 
ASP代码错误
如下ASP代码有误:
<html>
<head>
<title>MDB Data Write Sample</title>
</head>
<body>
</body>
</html>
<%
  Dim Conn,RS,RS2,RS3,RS4,RS5,RS6,RS7
  Set Conn = Server.CreateObject('ADODB.Connection')
  Conn.Provider = 'Microsoft.Jet.OLEDB.4.0'
  Conn.Open '\Stu.mdb' //数据库为该页根目录下的Stu.mdb
  //插入数据
  Set RS = Conn.Execute(INSERT into Stu VALUES(STU_01,'司马懿))
  Set RS2 = Conn.Execute(INSERT into Stu VALUES(STU_02,'诸葛亮'))
  Set RS3 = Conn.Execute(INSERT into Stu VALUES(STU_03,'曹操'))
  Set RS4 = Conn.Execute(INSERT into Stu VALUES(STU_04,'大乔'))
  Set RS5 = Conn.Execute(INSERT into Stu VALUES(STU_05,'黄月英'))
  Set RS6 = Conn.Execute(INSERT into Stu VALUES(STU_06,'貂婵'))
  //查询数据
  Set RS7 = Conn.Execute(Select * From Stu)
  //显示RS7
  Response.Write RS7 <BR>
  Response.Write "数据操作 已完成"
  Conn.Close
%>
错误为Syntax Error,错误句为Set Conn = Server.CreateObject('ADODB.Connection')
怎么回事?
搜索更多相关主题的帖子: into head 诸葛亮 司马懿 根目录 
2012-12-31 18:01
ds15fkcjj
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2012-12-8
得分:0 
Access啊!代码改了N次都出错,怎么回事呢?
修改过的Code:
<html>
<head>
<title>MDB Data Write Sample</title>
</head>
<body>
</body>
</html>

<%
  Dim conn,RS,RS2,RS3,RS4,RS5,RS6,RS7
  Set conn = Server.CreateObject("ADODB.connection")
  conn.Provider = "Microsoft.Jet.OLEDB.4.0"
  conn.Open "\Stu.mdb"
  Set RS = conn.execute(insert into Stu values("STU_01","司马懿"))
  Set RS2 = conn.execute(insert into Stu values("STU_02","诸葛亮"))
  Set RS3 = conn.execute(insert into Stu values("STU_03","曹操"))
  Set RS4 = conn.execute(insert into Stu values("STU_04","大乔"))
  Set RS5 = conn.execute(insert into Stu values("STU_05","黄月英"))
  Set RS6 = conn.execute(insert into Stu values("STU_06","貂婵"))
  Set RS7 = conn.execute(Select * From Stu)
  Response.Write RS7 <BR>
  Response.Write "数据操作 已完成"
  conn.close
%>
提示这一行有错Set RS = conn.execute(insert into Stu values("STU_01","司马懿"))
2013-01-01 17:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-394680-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.057764 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved