长丰猎豹q6:ASP问题,在百度,这点问题都解决不了了?

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 03:29:43
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("database/db.mdb")
%>
<% if not request.QueryString("id") ="" then
ind=request.QueryString("id")
else
ind="1"
end if
%>
<%
jl="select*from tb where id='"+ind+"'"
set rs=server.createobject("adodb.recordset")
rs.open jl,conn,1,1 ' 说是这里有错,驱动程序不支持所需的属性
%>

<%
On Error Resume Next
dim startime,endtime
startime=timer()
dim conn,dbpath
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath("database/db.mdb")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
%>

===========
<%
set rs=server.createobject("adodb.recordset")
sql="select * from tb where id="&ind
rs.open sql,conn,1,1
%>

这句删除
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

不要改了,哪里的错了?你只打开了recordset却没打开connection你说会不会错呢?在上面也一个打开吧! 还有rs.open应该打开的是recordset对象连接患,你却打开sql连接串 jl="select*from tb where id='"+ind+"'"有这个必要吗?
别的不说了,有问题要好好想想,你明白了就自已写吧

改成
rs.open jl,conn,1,3试试、

rs.open ji,conn,3,1(对的阿)