asp 连接Access的问题

来源:百度知道 编辑:UC知道 时间:2024/05/13 12:10:03
<%
if request.Form("&idd&")<>"" then
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("luntanshow.mdb")
set rs=server.createobject("adodb.recordset")
idd=request.Form("&idd&")
exec="select*from messagead where id='&idd&'"
rs.open exec,conn,1,3
if not rs.eof and not rs.bof then
%>
ide=<%=rs("id")%>
dear=<%=rs("dear_1")%>
ip=<%=rs("ip")%>
message=<%=rs("message_1")%>

<tr>
<td class="mygx"><%response.Write(ide)%></td>
<td class="mygx"><%response.Write(dear_1)%></td>
<td class="mygx"><%response.Write(ip)%></td>

<td class="mygx"><%=message%>&

request.Form("&idd&") 改为 request.Form("idd")
exec="select*from messagead where id='&idd&'"
改为 exec="select*from messagead where id="&idd

if not (rs.eof or not rs.bof) then 改为 if not rs.eof then

提示是什么错误?
你这个要设置数据源的.

<% 
if request.Form("idd") <>"" then 
    set conn = server.createobject("adodb.connection") 
    conn.open "driver={microsoft access driver (*.mdb)};dbq=" & server.mappath("luntanshow.mdb") 
    set rs = server.createobject("adodb.recordset") 
    idd = request.Form("idd") 
    exec = "select * from messagead where id=