方法如下:第一种连接和记录集分开声明<%db="db/darden.mdb"set conn=server.createobject("ADODB.connection")connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("" & db & "")conn.open connstr%><% set rs=server.createobject("adodb.recordset")sql="select * from ebook order by id desc"rs.open sql,conn,3,3rs.addnew ............rs.update (rs.delete)rs.closeset rs=nothingconn.closeset conn=nothingresponse.write("<center><a href=viewdatabase.asp>显示文字</a></center>") Response.Redirect "homepage.asp"%> 第二种连接和记录集一同声明<% set rs=server.createobject("adodb.recordset")sql="select * from ebook order by id desc"conn = "DBQ=" + server.mappath("book.mdb") + ";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"rs.open sql,conn,3,3rs.addnew ............rs.update (rs.delete)rs.closeset rs=nothingresponse.write("<center><a href=viewdatabase.asp>显示文字</a></center>") %> ASP数据库简单*作教程<1>.数据库连接(用来单独编制连接文件conn.asp)<%Set conn = Server.CreateObject(ADODB.Connection)conn.Open DRIVER={Microsoft Access Driver (*.mdb)}; DBQ= & Server.MapPath(\bbs\db1\user.mdb) %>