这段代码真的有错吗????
来源:百度知道 编辑:UC知道 时间:2024/05/13 14:32:06
<%
dim conn,DBPath,sql,rs
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("../database/myasp.mdb")
conn.Open"Provider=Microsoft.Jet.Oledb.4.0; Data Source=" & DBPath
set rs=server.createobject("adodb.recordset")
sql="select * from count,count_history"
rs.open sql,conn,1,3 %>
错误类型:
Microsoft JET Database Engine (0x80040E14)FROM 子句语法错误。
conn.asp, 第 10 行
(注:第10行就是最后一句)
大家说的,我都试了!可错误还是一样的!!!真的很郁闷啦!
dim conn,DBPath,sql,rs
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("../database/myasp.mdb")
conn.Open"Provider=Microsoft.Jet.Oledb.4.0; Data Source=" & DBPath
set rs=server.createobject("adodb.recordset")
sql="select * from count,count_history"
rs.open sql,conn,1,3 %>
错误类型:
Microsoft JET Database Engine (0x80040E14)FROM 子句语法错误。
conn.asp, 第 10 行
(注:第10行就是最后一句)
大家说的,我都试了!可错误还是一样的!!!真的很郁闷啦!
应该是count,count_history中有命名重复的字段,如果涉及到两个表的话,最好是select 后的字段选择部分加上选择是的那个表:
如:
select count.* from count,count_history
或
select count_history.* from count,count_history
再或
select count.*,count_history.字段1,count_history.字段2 from count,count_history
它说的是你的SQL语句错误/看看有没有这两个表名~
楼下的。
select 字段1,字段2 from 表1,表2
好像没错!
select * from count,count_history
count,count_history是什么?
select语法
select * from [表名]
select 字段1,字段2 from [表名]
表名就能一个
select count.*,count_history.* from count,count_history