备忘 - ASP数据库相关,话说对于下边这个程序直接用XLS文件比较好吧。。但是测试了几次不成功。。唉。。
<%
On Error Resume Next
set conn = server.CreateObject("adodb.connection")
conn.open "provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("database.mdb")
set rs = server.CreateObject("adodb.Recordset")
rs.open "select top 5 * from table Order By Rnd(" & Rnd() & "-id)",conn,2,3
Dim RW_URL
Randomize
Do While (Not rs.eof)
If count = 1 then
rs.update "RD",Int(1000*Rnd()+1)
End if
RW_URL = "<li><a href=""" & rs("URL") & """ target=""_blank"">" & rs("URL") & "</a></li>" & rs("ID")
Response.Write RW_URL & vbCrLf
rs.MoveNext
Loop
rs.close
set rs = nothing
conn.close
set conn = nothing
%>