写了一段代码,运行时老出现问题,不知为什么?
代码如下:
1、数据库链接:
<!--#include file="conn.asp"-->
conn.asp的代码是:
<%
set conn=server.createobject("adodb.connection")
conn.open "dsn=lJ"
//response.write "成功"
%>
2、声明变量:
<%
const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim typename
dim keyword
keyword=trim(request("keyword"))
typename=request.Querystring("typename")
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
3、java程序
<script>
<!--
function openwin(id){ window.open("viewarticle.asp?id="+id,"","height=450,width=550,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
//-->
</script>
4、
if typename="" then
sql="select * from learning where title like '%"&keyword&"%' order by articleid asc"
else
sql="select * from learning where type='"&typename&"' and title like '%"&keyword&"%' order by articleid asc"
end if
dim sql,rs
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
5、最后
rs.close
set rs=nothing
conn.close
set conn=nothing
现在的问题是运行后出 :错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC 驱动程序不支持所需的属性。
/feishui/INC/cxindex.asp, 第 209 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
第 209 行的代码是:rs.open sql,conn,1,1