asp错误类型:ADODB.Recordset (0x800A0E79)

来源:百度知道 编辑:UC知道 时间:2024/05/15 10:14:17
代码是这样写的,应该没有错,可是它老是叫错。

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%

dim connstr
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("tang.mdb")
set conn=Server.CreateObject("ADODB.Connection")
conn.open connstr

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>写操作</title>
</head>

<body>
<%
set rs=server.createOb

这样写

<%
set rs=server.createObject("adodb.recordset")
a=request.form("name")
sql="select * from tangself where [name]='"&a&"'"
rs.open sql,conn,1,3
if not rs.eof and not rs.bof then
response.write "用户名:"& request.form("name") & "已经被占用!请返回上一页!"
response.end
else
rs.addnew
rs("name")=request.Form("name")
rs("password")=request.Form("password")
rs.update
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>