ASP sql问题??

[复制链接]
查看11 | 回复3 | 2010-8-8 00:47:52 | 显示全部楼层 |阅读模式
set rs=server.createobject("adodb.recordset")
sql="select * from new where id ='"&id_first&"'"
rs.open sql,conn1,1,1
SQL哪里错了??
其中 id_first
id_last
是获取表单中的初值和未值!
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC 驱动程序不支持所需的属性。
/admin/Article/new_id_from1.asp, 第 52 行

回复

使用道具 举报

千问 | 2010-8-8 00:47:52 | 显示全部楼层
如果我没猜错的话,你的字段都是数值型吧!该成下面的试试!set rs=server.createobject("adodb.recordset") sql="select * from new where id ="&id_first&"" rs.open sql,conn1,1,1 还一个就是用between吧set rs=server.createobject("adodb.recordset") sql="select * from new where id between "&id_first&" and "&id_last&"" rs.open sql,conn1,
回复

使用道具 举报

千问 | 2010-8-8 00:47:52 | 显示全部楼层
sql.....单引号->chr(39)?
回复

使用道具 举报

千问 | 2010-8-8 00:47:52 | 显示全部楼层
从语法上讲,你提供的语句没有任何错误。为什么不贴出错误提示信息?出错的原因有以下几种可能:1、id_last和id_first变量没有获取到正确的值,你可以在SQL语法下加 Response.Write SQL看看。2、SQL语法中的数据库表名或字段名错误,即那个NEW和ID。3、数据所在目录权限不足或CONN1连接数据库错误。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行