哪位大侠能给我指点一下我的代码有什么问题!谢谢! <% dim startime,endtime,conn,connstr,db startime=timer() db="data\db1.mdb" Set conn = Server.CreateObject("ADODB.Connection") connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db) 'connstr="driver={Microsoft Access Driver (*.mdb)};dbq="&Server.MapPath(db) conn.Open connstr Function CloseDatabase conn.close() set conn=Nothing End Function %> 这是我的连接数据库代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--#include file="Conn.asp" --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档</title> </head>
<body>
<% Dim rs set rs=server.CreateObject("ADODB.Recordset") mySql = "INSERT dan VALUES('33','430000')" rs.Open mySql,cn,2,3 rs.Open "SELECT * FROM dan",cn %> <p align="center">已注册ID列表</p> <table border="1" cellpadding="0" cellspacing="0" bordercolor="#111111" width="336" align=center> <tr> <td width="97">注册ID</td> <td width="97">注册密码</td> </tr> <% Do While Not rs.Eof %> <tr> <td width="97"><%=rs(0)%> </td> <td width="97"><%=rs(1)%> </td> </tr> <% If Not rs.Eof Then rs.MoveNext Loop %> </table> <% rs.close set rs=nothing %>
</body>
</html> 错误类型: ADODB.Recordset (0x800A0BB9) 参数类型不正确,或不在可以接受的范围之内,或与其他参数冲突。 /lianxi/Untitled-1.asp, 第 16 行