asp读取部分access数据
作一个在线投稿系统,怎么写查询当前用户所投过的稿,只读取当前用户的,不显示其它用户的!谁给个例子。谢谢!!!<%Dimconnstrconnstr="Provider=M...
作一个在线投稿系统,怎么写查询当前用户所投过的稿,
只读取当前用户的,不显示其它用户的!
谁给个例子。谢谢!!!
<%Dim connstr
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("wgl.mdb")
Set exec = Server.createObject("ADODB.Connection")
exec.Open connstr
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查看稿件</title>
</head>
<%
set rs = server.CreateObject ("adodb.recordset")
rs.open "select * from gao",exec,1,1
%>
<body>
<%if rs.EOF and rs.BOF then
response.write("暂时还没有文章")
else
Do Until rs.EOF
response.write("<br>作者:"&rs("UserName"))
response.write("<br>文章标题:"&rs("title"))
response.write("<br>文章内容:"&rs("comment"))
response.write("<hr>")
rs.MoveNext
Loop
end if%>
<%rs.close
set exec=Nothing%>
</body>
</html>
这是查看所有用户的,如何修改只查看当前登录的用户 展开
只读取当前用户的,不显示其它用户的!
谁给个例子。谢谢!!!
<%Dim connstr
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("wgl.mdb")
Set exec = Server.createObject("ADODB.Connection")
exec.Open connstr
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查看稿件</title>
</head>
<%
set rs = server.CreateObject ("adodb.recordset")
rs.open "select * from gao",exec,1,1
%>
<body>
<%if rs.EOF and rs.BOF then
response.write("暂时还没有文章")
else
Do Until rs.EOF
response.write("<br>作者:"&rs("UserName"))
response.write("<br>文章标题:"&rs("title"))
response.write("<br>文章内容:"&rs("comment"))
response.write("<hr>")
rs.MoveNext
Loop
end if%>
<%rs.close
set exec=Nothing%>
</body>
</html>
这是查看所有用户的,如何修改只查看当前登录的用户 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询