<% err.Clear on error resume next Set conn = Server.CreateObject("ADODB.Connection") conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/mydb/guestbook.mdb") if err.number<>0 then Response.Write "conn err:" & err.Description Response.End end if sub dbclose conn.close:set conn=nothing end sub %> Untitled Document
.:.:: 访客留言 ::.:.
| 我也留言 |
<% mysql="select * from GuestBook order by G_date desc" set rs=server.createobject("adodb.recordset") rs.open mysql,conn,1,1 while not rs.eof if not rs.eof then %>

" width="56" height="70">
留言者:<%=rs("G_User")%> [ <%=rs("G_date")%> ]
 
<% Response.Write Replace(Replace(rs("G_Body"),chr(13),"
"),chr(10)," ") %>
<% rs.MoveNext end if if not rs.eof then %>

留言者:<%=rs("G_User")%> [ <%=rs("G_date")%> ]
 
<% Response.Write Replace(Replace(rs("G_Body"),chr(13),"
"),chr(10)," ") %>
" width="43" height="70">
<% rs.movenext end if wend rs.close %>
 
©2002 Bopeng.net 版权所有.转载必究
<% dbclose %>